Tuesday, November 11, 2014

Re: String.matches() does not work with \p{ASCII}

hi please can u give me full code to figure out this kind of  problem same thing happen to me.


On Friday, August 13, 2010 10:38:37 PM UTC+1, Vlad wrote:
Thanks, with the hexidecimal range 00, 7F it works.

On 13 авг, 01:17, cokol <eplisc...@googlemail.com> wrote:
> as you probably know, regex is belongs to that cases not fully
> compatible between java and javascript, and in dev mode your GWT
> engine uses real JDK therefore it works, whereas after compilation
> your matches() is performed on the browser with its regex engne and it
> fails.
>
> well u have to rewrite the pattern \\p{ASCII}* to JS compatible
> fashion
>
> On 12 Aug., 00:39, Vlad <vsinit...@gmail.com> wrote:
>
>
>
> > Hi,
> > I have a simple code that works correctly in development mode but
> > fails to run on production.
> > Basically, I need to check if the text entered by user contains only
> > ASCII characters. So, I do the following:
>
> > String s = getTextArea().getText();
> > if(s.matches("\\p{ASCII}*"))
> > {
> > ...}
>
> > else
> > {
> > // Some non ASCII characters found
>
> > }
>
> > On the production it always comes to the "else" section. I've tried it
> > with IE, FireFox and Chrome. The results are the same.
> > Any suggestions of how to fix this?

--
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