Regular Expressions To Match Common Special Characters (Unicode Symbols)

Regular expressions can offer a level of complexity and depth many developers fail to utilize. There are regular expressions all over the place but for those looking for something with a bit more detail, I’ve put together several regular expressions that can be used to match specific special characters and Unicode symbols like ❤, ®, €…

Heart ❤

/\u2764/

Registered Trade Mark Sign ®

/\u00AE/

Trademark Symbol ™

/\u2122/

Dollar Sign $

/\u0024/

Euro Sign €

/\u20AC/

Pound Sign £

/\u00A3/

Japanese Yen/Renminbi ¥

/\u00A5/

Indian Rupee Sign ₹

/\u20B9/

Ruble Sign ₽

/\u20BD/

Conclusion:

Regex patterns can be very helpful in matching strings of text. One reason is that they are highly flexible, another reason is that they provide you with better control than just a string’s normal find function.

Hopefully, this article has covered the basics of how to get familiar with regular expressions and how they can be useful in a design tool.

See Also: