I wrote a regx for validating a name field in php as,
/^[\pL\s]+$/u and its working as i expected EX: preg_match("/^[\pL\s]+$/u", "test#");
Now i need to do the same validation in cliend side. for that I need to convert that in to javascript regex. I tried,
/^[\pL\s]+$/u.test(filed_value)
and its not working as php, Im getting a console error. How can i convert the php regx to javascript regex?
This should false.
echo preg_match("/^[\pL\s]+$/u", "abc%$");
Should accept these
echo preg_match("/^[\pL\s]+$/u", "abc");
echo preg_match("/^[\pL\s]+$/u", "ab c");
echo preg_match("/^[\pL\s]+$/u", "abåcå");
falsefor every input :(umodifier is not supported by javascript as it do withPHPorPCREand even javascript matches a character\pandLindividually its also not supported by javascript. Can you post some inputs along with expected outputabcdefand i needtrueas out put, if the input val =abc%$it should be false.