how to set regex for full name in spry framework

322 Views Asked by At

I want to change below php regex for java script regex to use them in spry validation framework. 1)"/^[\d]+$/"
2)"/^([\x{600}-\x{6FF}]+\s)*[\x{600}-\x{6FF}]+$/u"
3)"/^([\x{600}-\x{6FF}]+\d*\s)*[\x{600}-\x{6FF}]+\d*$/u"
I don't know difference between php format and javascript format in above regexs.

1

There are 1 best solutions below

3
On

Regex patterns in PHP are enclosed in quotations AND delimiters such as // or @@. In javascript, regex patterns don't need to be enclosed in strings.

If that's not the problem, then you need to post more code for us to help.

In PHP:

preg_match('/hello/','hello world');

In javascript:

'hello world'.match(/hello/);