Closed strejcek closed 10 years ago
\\.
matches a backslash followed by any character,[^\\"]
matches any character that is not a backslash or double-quote,(\\.|[^\\"])*
match a sequence of any combination of the above two,"(\\.|[^\\"])*"
simply requires double-quotes around that.For a rationale, consider a string with escaped double-quotes such as "hello \"world\"\n"
.
I get it. Thanks for explanation. (I'm not skilled enough in this backslash gymnastics.)
Can you please explain the regular expression. I don't get the double backslashes and the meaning of .|[^"] - it seems to me that this matches any character, or not?