PHP Regular expression to match unescaped double quotes
I'm trying to figure out a regular expression that will detect if there is an unescaped double quote within two double quotes. I have this, but it's not working:
if ( preg_match( '/^(\".*((?<!\\)\").*\")$/',开发者_开发百科 $str ) ) {
die("hey");
}
Try with preg_match('/([^\\]\")/', $str)
精彩评论