Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an equivalent to Java's \p{Punct} in Haxe regexes?

Tags:

java

regex

haxe

Haxe's manual has no regex symbol detail. I can't find which symbol maps to Java's \p{Punct}.

Does Haxe have anything similar?

like image 247
guawoo Avatar asked Sep 27 '22 00:09

guawoo


1 Answers

According to the documentation, the punctuation unicode character class seems to be only available when you use PCRE (Neko, C++, PHP) and for Java and C#. Whatever, you can try different syntaxes with or without an escaped backslash: \p{Punct} \p{P} \pP and eventually the POSIX character class: [[:punct:]]

These classes are not available for JavaScript (and probably not for Flash either). In this case the way is to put all punctuation characters in a class using ranges as most as possible.

like image 111
Casimir et Hippolyte Avatar answered Oct 13 '22 00:10

Casimir et Hippolyte