I've got a regular expression that matches strings opening with "
and closing with "
and can contain \"
.
The regular expression is this \"".*[^\\]"\"
.
I don't understand what's the "
that is followed after \"
and after the [^\\]
.
Also this regular expression works when I have a \n
inside a string but the .
rule on flex doesn't match a \n
.
I just tested for example the string "aaaaa\naaa\naaaa"
.
It matched it with no problem.
I made a regex for flex that matches what I need. It's this one \"(([^\\\"])|([\\\"]))*\"
. I understand how this works though.
Also I just tested my solutions against an ""
an empty string. It doesn't work. Also the answers from all those that answered have been tested and don't work as well.