Saturday, May 30, 2015

RegExp on TextResource


Hi All,

I am trying to apply a regular expression on a TextResource (which is an html file),

but it does not work. I can see the content of the resource as strign. If I provide the content of the file directly to RegExp it works.

String html = ReadHtmlResources.INSTANCE.
                    getDocumentationHtml().getText();

RegExp regExp = RegExp.compile("<p id='pid'>(.*?)</p>");

MatchResult matcher = regExp.exec(html);

boolean matchFound = matcher != null; // returns false


Any idea why this does not work?

Cheers,
Alireza

--
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/d/optout.

No comments:

Post a Comment