I'm trying to get all strings wrapped in double quotes with this regexp:
"(?:[^"\\]|\\.)*"
I already tried it on this site: http://www.phpliveregex.com/ and it works, but when i put it in my php code like this:
if( preg_match('/"(?:[^"\\]|\\.)*"/', $input_line, $output_array) )
{
.
.
.
}
I'm getting this error:
Warning: preg_match(): Compilation failed: missing terminating ] for character class at offset 15
what am i missing?
SOLVED:
AS mario pointed out, a backslash was being escaped by PHP I got it working like this:
if( preg_match('/"(?:[^"\\\]|\\.)*"/', $sLine, $matches) ){
.
.
.
}