-----Original Message-----
From: Kristofer Wolff [mailto:[EMAIL PROTECTED]]

I using:

$p =~ s/\[\+(.*)\]//;
--------------------------

Try

$p =~ s/\[\+(.*?)\]//;

or

$p =~ s/\[\+(.*?)\]//g;

to remove all of them.

the ? after the * makes it "non-greedy" ie it attempts to collect the
minimum matching set instead of the largest matching set.

Sometimes ? won't solve your problem for various reasons, and you may have
to replace your .* with

[^\]]*

which is a "character class" which means "all characters that are not ]"

NOTE: the \ is not actually needed in this position because of an arcane
principle that all character classes should have at least ONE character, and
therefore a ] is "free" in first position. However, if there were any other
characters in the class, you would have to \ the ] so you may as well be
consistent.

Needless to say, this can be combined with ? to use

[^\]]*?

in appropriate circumstances.
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to