$n = 5; $char = 'l'; $string = 'hello my name is william gobbel-dy-gook liam'; $count = 0; while ($string =~ /[$char]/g) { $match = $`; $count++; last if $count == $n; } print $match;
In reply to Re: match n EMth/EM occurence
by smgfc
in thread match n EMth/EM occurence
by arindamm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |