shockme has asked for the wisdom of the Perl Monks concerning the following question:
I need a regex that will give me You want this code but not want this code (contained within the second set of brackets).[You want this code]. But under no circumstances do you \[want this c +ode]\.
All I've been able to come up with is something that will break out on plain brackets. I need to be able to tell the regex engine to break on brackets but not on \brackets\.
(It is safe to assume that brackets and \brackets\ will always occur in pairs, however, brackets may occur within \brackets\.)
Any thoughts?
If things get any worse, I'll have to ask you to stop helping me.
Edit kudra, 2002-05-27 Corrected title
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(elbie): regex for but not \\
by elbie (Curate) on May 27, 2002 at 01:00 UTC | |
|
Re: regex for but not \\
by graff (Chancellor) on May 27, 2002 at 00:58 UTC | |
|
•Re: regex for but not \\
by merlyn (Sage) on May 27, 2002 at 13:59 UTC |