Marcos, 

Try this : 
my $str = 'aaa--%%b%bb%%--ccc--%%ddd%%--';

$str =~ s/(-{2}\%{2})(.*?)(\%{2}-{2})/$1$3/g;
print "Modified str = ".$str."\n";


you will get

Modified str = aaa--%%%%--ccc--%%%%--

Is it what you want ??

Michel




-----Message d'origine-----
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Date: mardi 25 novembre 2003 09:20
À: [EMAIL PROTECTED]
Objet: Regular Exprections


I have this string
my $str =
'aaa
--%%
bbb
%%--
ccc
--%%ddd%%--';

And I need to remove every thin bettewin '--%%' and '%%--'.
Lets say /--\%\%[^\%]*\%\%--/ works more or less. The problem is if I have

my $str =
'aaa
--%%
b%b
%%--
ccc
--%%ddd%%--';

Who can I resolve this problem?

Thanks
Marcos

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to