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";
}
精彩评论