Hi,
If I have a string "LLL" and I want to capture a count of how many times "LL" occurs, I would expect the count to be 2, but in the way my regular expression is written I'm getting a count of only 1. Do I have to use seek to get the appropriate count? Here's what I've written. How can I get it to recognize the last two LLs as a pair?
my @matches = ($_=~m/.*("LL").*/g); if(@matches){foreach(@matches){$counter++;}}
In reply to Regex catching multiple characters next to each other by Jeri
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |