Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ticky/ruby-emoji-regex

💎 A set of Ruby regular expressions for matching Unicode Emoji symbols.
https://github.com/ticky/ruby-emoji-regex

emoji regex regexp regular-expression unicode

Last synced: 1 day ago
JSON representation

💎 A set of Ruby regular expressions for matching Unicode Emoji symbols.

Awesome Lists containing this project

README

        

# Ruby Emoji Regex 💎

[![Gem Version](https://badge.fury.io/rb/emoji_regex.svg)](https://rubygems.org/gems/emoji_regex) [![Node & Ruby CI](https://github.com/ticky/ruby-emoji-regex/workflows/Node%20&%20Ruby%20CI/badge.svg)](https://github.com/ticky/ruby-emoji-regex/actions?query=workflow%3A%22Node+%26+Ruby+CI%22)

A Ruby regular expression for matching Unicode Emoji symbols.

## Background

This is based upon the fantastic work from [Mathias Bynens'](https://mathiasbynens.be/) [`emoji-test-regex-pattern`](https://github.com/mathiasbynens/emoji-test-regex-pattern) package. `emoji-test-regex-pattern` is cleverly assembled based upon data from the Unicode Consortium.

The regular expressions provided herein are derived from that package.

## Installation

```shell
gem install emoji_regex
```

## Usage

`emoji_regex` provides the `EmojiRegex::Regex` regular expression, which matches emoji, as defined by [the Unicode standard's `emoji-test` data file](https://unicode.org/Public/emoji/14.0/emoji-test.txt).

### Example

```ruby
require 'emoji_regex'

text = <