go ahead... be a heretic | |
PerlMonks |
Re: how to find substring using regexby hbm (Hermit) |
on Jun 22, 2011 at 17:55 UTC ( [id://910952]=note: print w/replies, xml ) | Need Help?? |
Your code would increment $cnt once if the expression is true (matches one or more times). You could turn it around like this:
Note also that you don't need to store the matches (with parentheses) for what you are doing. And the '+' modifier in your example would match 'harsh' and 'harshhhhhhhhhh'. Is that what you meant?
In Section
Seekers of Perl Wisdom
|
|