Tim,
BBEdit is PCRE2 16-bit based so maybe a unicode regular expression can help
you. But Unicode is tricky and defining what applies as an emoji depends on
many factors and possible combinations.
This regular expression seems to catch many emoticons, emojis, etc. but I
don't know if it is exhaustive.
At least it seems to work in BBEdit and can be modulated to select specific
Unicode blocks.
```
(*UTF)(?x)
[\N{U+2700}-\N{U+27BF}] (?# Dingbats 192)
|[\N{U+1F000}-\N{U+1F02F}] (?# Mahjong Tiles 44)
|[\N{U+1F030}-\N{U+1F09F}] (?# Domino Tiles 100)
|[\N{U+1F0A0}-\N{U+1F0FF}] (?# Playing Cards 82)
|[\N{U+1F100}-\N{U+1F1FF}] (?# Enclosed Alphanumeric Supplement 193)
|[\N{U+1F200}-\N{U+1F2FF}] (?# Enclosed Ideographic Supplement 64)
|[\N{U+1F300}-\N{U+1F5FF}] (?# Miscellaneous Symbols and Pictographs 768)
|[\N{U+1F600}-\N{U+1F64F}] (?# Emoticons 80)
|[\N{U+1F650}-\N{U+1F67F}] (?# Ornamental Dingbats 48)
|[\N{U+1F680}-\N{U+1F6FF}] (?# Transport and Map Symbols 110)
|[\N{U+1F700}-\N{U+1F77F}] (?# Alchemical Symbols 116)
|[\N{U+1F780}-\N{U+1F7FF}] (?# Geometric Shapes Extended 101)
|[\N{U+1F800}-\N{U+1F8FF}] (?# Supplemental Arrows-C 148)
|[\N{U+1F900}-\N{U+1F9FF}] (?# Supplemental Symbols and Pictographs 244)
|[\N{U+1FA00}-\N{U+1FA6F}] (?# Chess Symbols 98)
|[\N{U+1FA70}-\N{U+1FAFF}] (?# Symbols and Pictographs Extended-A 16)
```
Best regards,
Jean Jourdain
On Saturday, October 24, 2020 at 5:03:21 PM UTC+2 Tim A wrote:
> How do I strip emoji characters from a body of text?
>
> 😳 🤣🤣
>
> ♥️
>
> 🥰
>
>
>
--
This is the BBEdit Talk public discussion group. If you have a feature request
or need technical support, please email "[email protected]" rather than
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/bbedit/5e86f9a3-0ad9-4100-89d8-0850d3c41574n%40googlegroups.com.