Forgot your password?
typodupeerror

Comment Matching what's between things (Score 1) 516

I realise nobody is still reading this, and as this is my first ever post it'll come in way below most readers' filters anyway. However, I didn't see it posted (though I'm reading at quite a high filter level too), and it's pretty useful:

To match something between quotation marks, for example, do:
m/"[^"]+"/

Which says, match a quote, followed by at least one character which isn't a quote, followed by a quote.

There are further refinements to this, and it doesn't allow for quotes within quotes, or for empty quotes (""), but it does what you want most of the time.

This and other gems are to be found in Jeffrey Friedl's Mastering Regular Expressions.

Slashdot Top Deals

My sister opened a computer store in Hawaii. She sells C shells down by the seashore.

Working...