开发者

What's the equivalent of this Javascript regexp in PHP?

I have this js regexp which I need in PHP code now instead:

var al开发者_JAVA百科phaExp = /^[a-zA-ZåäöÅÄÖ\s\-]+$/;
if (!fld.value.match(alphaExp)) {
  //ERROR OUTPUT HERE
}

Whats the equivalent to this in PHP?


$string = "åäöÅÄÖ";
$alphaExp = "/^[a-zA-ZåäöÅÄÖ\s\-]+$/";
if(!preg_match($alphaExp, $string)) {
  //ERROR OUTPUT HERE
  echo "ERROR";
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜