【发布时间】:2015-05-07 10:06:53
【问题描述】:
我有以下代码 sn-p 我想匹配用户提供的输入以匹配正则表达式中指定的任何输入。一切正常,但 \n 部分,我想允许多行。这尤其行不通。
if(preg_match("/[^A-Za-z0-9., \/-\n]/", $addr))
{
echo "Invalid user input ";
exit;
}
我收到消息
Warning: preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset 17 in ......
朋友告诉我这里如何允许多行。
【问题讨论】:
标签: regex preg-match