Re: How to use javascript's regular expression by jsni?

2014-11-20 Thread Thomas Broyer
"\s" and "\[" (among others) in a JS string are equivalent to "s" and "[", so you have to escape the backslash. Also, your "escape special characters" is messing with your regexp, turning your [0-9]{1,3} into \[0\-9\]\{1\,3\} (among others) which does not mean the same thing at all. Or maybe ju

Re: How to use javascript's regular expression by jsni?

2014-11-20 Thread Alex Luya
Sorry,there is typing mistake in my question:the returning type of reEmail() isn't boolean but String,and my code is: private native String reEmail()/-*{ return "^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"...@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,

Re: How to use javascript's regular expression by jsni?

2014-11-19 Thread Alberto Mancini
Hi, boolean reEmail() but you are using as a String in validate("t...@domain.com" ,reEmail()); then regexp in the validate method is 're' when used but 'regexp' as a parameter. On Thu Nov 20 2014 at 8:18:32 AM Alex Luya wrote: > Hello: > Similar question has been asked here: How t

How to use javascript's regular expression by jsni?

2014-11-19 Thread Alex Luya
Hello: Similar question has been asked here: How to pass a regular expression as a function parameter , but I can't get it work by JSNI. This is the string of the regular expression that