in reply to Multiple matching using m///

perhaps you should be using the s/// operator instead...
#!/usr/bin/perl -wT use strict; my $line = "I like 'balls' and 'rings', do you like 'rings' and 'balls +'?"; print "Before = $line\n"; $line =~ s/(balls|rings)//g; print "After = $line\n"; =output Before = I like 'balls' and 'rings', do you like 'rings' and 'balls'? After = I like '' and '', do you like '' and ''?

Update: Apparently the question is an AND one, not an OR one (which is what I provided an answer to). In general, I think mutiple regexes are best for this sort of thing. i.e. if (/balls/ && /rings/) { } there are tricky ways of doing this in one regex, but they tend to be slower, and less readable.

-Blake