Wednesday, January 22, 2014

Re: regexp only matches on first match ;(

It probably does: from memory, you have to call gim.exec(text) again to "iterate" over the matches.
See https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions, it works the same (given that it's a thin wrapper over the JS objects – and an emulation, in DevMode or otherwise "in a JVM").

On Wednesday, January 22, 2014 11:25:25 AM UTC+1, HamsterofDeath wrote:
this is my code
final RegExp gim = RegExp.compile(pattern, "gim");
final MatchResult re = gim.exec(text);

this is my pattern
(</?.*?>)

this is my input:
hs<b>dfd<i>fs</i></b><i>d</i>f<u>d sdf fsd</u>&nbsp; fsd<br><br>

why doesn't it match on all the tags?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment