A while ago, I also learnt that JavaScript regex has unicode support (via /.../u).
I always had to use XRegExp before.
Also, the syntax is a little different. XRegExp('\\p{Han}') vs /\p{sc=Han}/u.
For this, I also recommend this VSCode extension, so that you don't write an invalid regex. (Like, valid in some compilers, but not native JavaScript.)
For /\p{Letter}/u, I would normally write shorthand.
A while ago, I also learnt that JavaScript regex has unicode support (via
/.../u
).I always had to use XRegExp before.
Also, the syntax is a little different.
XRegExp('\\p{Han}')
vs/\p{sc=Han}/u
.For this, I also recommend this VSCode extension, so that you don't write an invalid regex. (Like, valid in some compilers, but not native JavaScript.)
For
/\p{Letter}/u
, I would normally write shorthand.You are my savior
This one really solved my problem