Find number of matches using Match
Summer <crazysummer2004-/[email protected]> Mon, 21 May 2012 18:44:25 -0700 (PDT)
| Newsgroups | gmane.comp.lang.perl.modules.template-toolkit |
|---|---|
| Message-ID | <[email protected]> |
Hey,
I am using the "match" method and I am looking for a regex in a string. For the sake of argument, lets say we are looking for "no" in the following.
testString =""no, i do not believe we could not go forward to the sea. I know. no;
so,
valHolder = testString.match("(?i:no)");
valHolder.size -> always gives me 1. Yet I am expecting 4 matches.
Is there a way I can know the count of the matches?
Thanks.
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates