adl / hoaf

Hanoi Omega-Automata Format
14 stars 2 forks source link

a C-like double-quoted string "(\\.|[^\\"])*" #9

Closed strejcek closed 10 years ago

strejcek commented 10 years ago

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?

adl commented 10 years ago

For a rationale, consider a string with escaped double-quotes such as "hello \"world\"\n".

strejcek commented 10 years ago

I get it. Thanks for explanation. (I'm not skilled enough in this backslash gymnastics.)