You're almost there, you simply need to count instead of simply checking for existance:
perlfaq4 - How can I count the number of occurrences of a substring within a string?
In reply to Re: count the maximum no.of occurence
by wind
in thread count the maximum no.of occurence
by sarvan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |