What is the negate expression of following XRegExp expression?
[\\p{Alphabetic}\\p{Nd}\\{Pc}\\p{M}]+
I used matchChain()
to get the words out of the sentence using above expression.
Now I'm going to use split()
using negate expression to get the same result but with containing delimiters for each words.
To negate
\p{…}
, use\P{…}
. For example, the inverse of\p{L}
is\P{L}
.Assuming you made a typo in your original regular expression, and
\\{Pc}
should be\\p{Pc}
, this becomes:To negate this, just uppercase
\\p{…}
into\\P{…}
:It should be possible to just do this as well: