js中:
re = new RegExp('(?:^|\\s+)' + 'hi' + '(?:\\s+|$)');
alert(re.test(' hi '));
能匹配
re = new RegExp('(?:^|\s+)' + 'hi' + '(?:\s+|$)');
alert(re.test(' hi '));
不能匹配
php中:
preg_match('/(?:^|\s+)hi(?:\s+|$)/',' hi ');
能匹pewi
preg_match('/(?:^|\\s+)hi(?:\\s+|$)/',' hi ');
能
js中必须转一次
这是为啥呢,
--
修改:SJTUIT FROM 222.71.40.*
FROM 222.71.40.*