我不知道为什么这不会工作...在多个regex跳棋和测试人员中完美地工作.但是当它运行它PHP我得到这个错误:
Warning: `preg_match()` [function.preg-match]:
Compilation failed: nothing to repeat at offset 6 in /home/splose/public_html/index/index.php on line 49
Run Code Online (Sandbox Code Playgroud)
即时运行:
if(preg_match('[\\/^$.|?*+():<>]', $username)){}
Run Code Online (Sandbox Code Playgroud)
也许你可以尝试划分你的模式?:
if(preg_match('/[\\/^$.|?*+():<>]/', $username)){}
Run Code Online (Sandbox Code Playgroud)
直接取自PHP Docs:
Often used delimiters are forward slashes (/), hash signs (#) and tildes (~).
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19679 次 |
| 最近记录: |