UPDATE: OP has been edited without notice since this reply and the others to date. Original code (with code tags added by /me) was:
$cnt =0 $str="hi hi harshmane hi hi"; if ($str=~/([harsh]+)/g) # cf current content { $cnt++; } print $cnt;
OP has been msgd that such changes without notice are unhelpful.
In reply to Re: how to find substring using regex
by ww
in thread how to find substring using regex
by harshmane
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |