in reply to Regular expressions: Extracting certain text from a line
You have \{.+?\}.
From your description, you don't want [] within {...} and you don't want {} within [ ... ], so your "in between" groups should reflect that:
/(\{[^\[\]]{}]+?\})|.../
I think there are ways to better extract stuff within matching pairs of parentheses, but in the long run, you'll have to look at a proper parser for your grammar.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regular expressions: Extracting certain text from a line
by Wcool (Novice) on Apr 07, 2014 at 11:45 UTC | |
by SimonPratt (Friar) on Apr 07, 2014 at 15:50 UTC |