[tpm] I wish I was better at regex's
Fulko Hew
fulko.hew at gmail.com
Wed Mar 9 11:32:06 PST 2011
On Wed, Mar 9, 2011 at 2:29 PM, Shaun Fryer <sfryer at sourcery.ca> wrote:
>
> It's very difficult to do without matching quotes, and hence key/value
> pairs. For instance, what if the comment contains a quote, just as the
> quotes may contain a semi-colon? In this case I've sidestepped the
> problem of escaped quotes by using a word-boundary (\b) match inside
> any matched quotes. the side effect of this, is that any spaces inside
> the quotes will count...
>
> good luck if you can do it without matching keys/values/quotes. I've
> already got beers riding on the solution. ;)
Thats why I then looked at things like:
Regexp::Common::balanced
Regexp::Common::comment
but I couldn't figure out how to apply them.
More information about the toronto-pm
mailing list