[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Matching non-escapped quote with Lua pattern
- From: Enrico Colombini <erix@...>
- Date: Mon, 03 Mar 2014 20:50:02 +0100
On 03/03/2014 19.34, Andrew Starks wrote:
Is there a way to do this with one pattern?
Perhaps you could put two captures in your pattern: the first one
anchored at the beginning of the string, with 0 or 1 occurrences (?) of
the non-escaped quote, then '.-' and the second one like you posted.
Then you could combine the two captures with 'or', so that if the first
one fails you get the second one.
Implementation details are left as an exercise to the reader. I'm lazy :-)