Recently I have created a regex, for my PHP code which allows only the letters (including special characters plus spaces), but now I’m having a problem with converting it (?) into the JavaScript compatible regex, here it is: /^[\s\p{L}]+$/u, the problem is the /u modifier at the end of the regex pattern, as the JavaScript doesn’t allow such flag.
How can I rewrite this, so it will work in the JavaScript as well?
Is there something to allow only Polish characters: Ł, Ą, Ś, Ć, …
The
/umodifier is for unicode support.Support for it was added to JavaScript in ES2015.
Read http://stackoverflow.com/questions/280712/javascript-unicode to learn more information about unicode in regex with JavaScript.
Polish characters:
All special Polish characters: