R
Rob Perkins
Hello,
I know I'm not a regular, and I'm new to the arcana of regular
expressions, so I'm a little stuck with two specific cases and I'm
hoping for a genius:
The case I'm most stumped on is an input string like this:
The "quick" brown "fox jumped ""over"" the" lazy dog.
Where what I want to have matched is the quoted strings, except that
paired doublequotes don't count, and I don't want to capture the
quotemarks. In other words, my desired matches are:
<>
quick
fox jumped ""over"" the
</>
If I use: /".+?"/, I get:
<>
"quick"
"fox jumped "
"over"
" the "
</>
....which isn't right. If I use /".+"/, I get:
<>
"quick" brown "fox jumped ""over"" the"
</>
....which also isn't right. So I don't know how to proceed and get the
match of the strings contained in doublequotes, with the paired
doublequotes escaped, and the matches without the quotes.
How would you do it?
Rob
I know I'm not a regular, and I'm new to the arcana of regular
expressions, so I'm a little stuck with two specific cases and I'm
hoping for a genius:
The case I'm most stumped on is an input string like this:
The "quick" brown "fox jumped ""over"" the" lazy dog.
Where what I want to have matched is the quoted strings, except that
paired doublequotes don't count, and I don't want to capture the
quotemarks. In other words, my desired matches are:
<>
quick
fox jumped ""over"" the
</>
If I use: /".+?"/, I get:
<>
"quick"
"fox jumped "
"over"
" the "
</>
....which isn't right. If I use /".+"/, I get:
<>
"quick" brown "fox jumped ""over"" the"
</>
....which also isn't right. So I don't know how to proceed and get the
match of the strings contained in doublequotes, with the paired
doublequotes escaped, and the matches without the quotes.
How would you do it?
Rob