Welcome to the Monastery | |
PerlMonks |
Re^2: Regex conditional match if previous match in same expression is true?by radiantmatrix (Parson) |
on Apr 09, 2007 at 18:47 UTC ( [id://609009]=note: print w/replies, xml ) | Need Help?? |
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?
<–radiant.matrix–>
Ramblings and references The Code that can be seen is not the true Code I haven't found a problem yet that can't be solved by a well-placed trebuchet
In Section
Seekers of Perl Wisdom
|
|