Closed amcghie closed 5 years ago
Perhaps I'm not using XRegExp correctly. I'm getting a unexpected result when executing: XRegExp("^[\\pPd]+$").test("-!-")
XRegExp
XRegExp("^[\\pPd]+$").test("-!-")
XRegExp("^\\pPd+$").test("-!-") // -> false - correct XRegExp("^[\\p{Dash_Punctuation}]+$").test("-!-") // -> false - correct XRegExp("^[\\pPd]+$").test("-!-") // -> true - unexpected // Replace \\pPd with the contents of "Dash_Punctuation" from "module.exports" XRegExp("^[\\-\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D]+$").test("-!-"); // -> false - expected
All of these results are correct, given that \pP matches !, and \pPd is two tokens -- \pP and d (literal character "d"). \p{Pd} is what you want.
\pP
!
\pPd
d
\p{Pd}
Perhaps I'm not using
XRegExp
correctly. I'm getting a unexpected result when executing:XRegExp("^[\\pPd]+$").test("-!-")