Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
151
rated 0 times [  152] [ 1]  / answers: 1 / hits: 16064  / 14 Years ago, thu, november 11, 2010, 12:00:00

We're using GWT 2.03 along with SmartGWT 2.2. I'm trying to match a regex like below in client side code.



Pattern pattern = Pattern.compile(\(/d+){4}\);
String testString1 = [ /2/4/5/6/8, /2/4/5/6];
String testString2 = [ ];

Matcher matcher = pattern.matcher(testString1);
boolean result = false;
while (matcher.find()) {
System.out.println(matcher.group());
}


It appears that Pattern and Matcher classes are NOT compiled to Javascript by the GWTC compiler and hence this application did NOT load. What is the equivalent GWT client code so that I can find regex matches within a String ?



How have you been able to match regexes within a String in client-side GWT ?



Thank you,


More From » java

 Answers
43

Consider upgrading to GWT 2.1 and using RegExp.


[#95000] Wednesday, November 10, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
admin

Total Points: 468
Total Questions: 103
Total Answers: 103

Location: Equatorial Guinea
Member since Sun, Feb 14, 2021
3 Years ago
;