我想在 php regex 下面更改 java script regex 以在 spry 验证框架中使用它们。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"
我不知道上述正则表达式中 php 格式和 javascript 格式之间的区别。
问问题
302 次
1 回答
0
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/);
于 2012-01-30T01:51:46.443 回答