in reply to Re: Regex conditional match if previous match in same expression is true?
in thread Regex conditional match if previous match in same expression is true?
From your expected results, I deduce you actually want a string that is surrounded by {...}, or one that is neither preceded by { nor followed by }.
That's correct: I want the string, optionally surrounded by braces. One brace on only one side is not acceptable. I'm glad that my listing of expected results was clearer than my description. ;-)
Your alternation approach certainly functions. However, I was also hoping to learn to use the conditional ( (?(COND)...) ) notation. So you answered the question I asked (thanks!); but left me with the one I didn't ask.
For my own education, can you think of a solution that uses the conditional notation, or would I be horribly abusing said to solve this problem?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Regex conditional match if previous match in same expression is true?
by ikegami (Patriarch) on Apr 09, 2007 at 19:33 UTC | |
by radiantmatrix (Parson) on Apr 10, 2007 at 15:55 UTC | |
by ikegami (Patriarch) on Apr 10, 2007 at 16:23 UTC | |
by radiantmatrix (Parson) on Apr 23, 2007 at 14:25 UTC | |
|
Re^3: Regex conditional match if previous match in same expression is true?
by demerphq (Chancellor) on Apr 09, 2007 at 22:02 UTC | |
by radiantmatrix (Parson) on Apr 10, 2007 at 15:59 UTC | |
by demerphq (Chancellor) on Apr 10, 2007 at 16:50 UTC |