Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have some data like this:
{[[group1 #xxx#]] text [[group2]] text2 [[group3 #something# else]]}
My task is simple: I wanna delete all groups "[...]" containing the chars "#...#". Text between groups must be left! After that there must be the "winning" group left, means the first from left "{" or nothing.
In this example it should be:
->" text group2 text2"
I tried this before:
$R =~ s/(.*?)(\[.*?\#.*?\#.*?\].*?)?(.*?)/$1$3/gm;
but it isnt satisfying.
Perhaps there is a PerlRegGuru out there? :-) thx
Alex
Code tags and general spification - dvergin 2002-11-19
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need a cool RegExpresseion. plz help
by sauoq (Abbot) on Nov 20, 2002 at 00:09 UTC | |
|
Re: Need a cool RegExpresseion. plz help
by nothingmuch (Priest) on Nov 19, 2002 at 23:55 UTC | |
by sauoq (Abbot) on Nov 20, 2002 at 00:38 UTC |