Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/ticky/ruby-emoji-regex
- Owner: ticky
- License: mit
- Created: 2017-07-05T04:45:51.000Z (over 7 years ago)
- Default Branch: develop
- Last Pushed: 2024-09-11T17:18:53.000Z (4 months ago)
- Last Synced: 2024-10-29T12:58:22.387Z (2 months ago)
- Topics: emoji, regex, regexp, regular-expression, unicode
- Language: Ruby
- Homepage:
- Size: 169 KB
- Stars: 39
- Watchers: 5
- Forks: 3
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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 = <