what is {P} supposed to be?
Any punctuation character like ".", "," etc
Where did you find that?
Why are you using both the RegExp constructor and an inline regexp? Remove the constructor and add the flag to the inline regex. /#((?:[^\s\p{P}]|_)+)/ug, and you get this result: > "eat #apple and #banana!".match(/#((?:[^\s\p{P}]|_)+)/ug) < [ "#apple", "#banana" ]
RegEx is constant and it is used in multiple places. If I might do some changes other functionality might break. So I didn't touch it.
Обсуждают сегодня