Method: Emoju::Data#regexp_for
- Defined in:
- lib/emoju/data.rb
#regexp_for(encoding) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/emoju/data.rb', line 38 def regexp_for(encoding) regexp = instance_variable_get("@emoji_#{encoding}_map".to_sym).keys. map { |codepoints| codepoint_regexp(codepoints) }. join("|") Regexp.new(regexp).freeze end |