is:$str = "ABCDEFGHIJKLM"; while ($str =~ /(BC|GH|LM)/g) { print "matched $1\n"; }
Which I think is what you needed. You'll get a match line for each of them, so long as they don't overlap.matched BC matched GH matched LM
--
Steve Marvell
In reply to Re: use of 'or' in regex
by marvell
in thread use of 'or' in regex
by Becky
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |