We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
match() bug (Read 598 times)
match() bug
Feb 14th, 2008, 5:04pm
 
Have been messing around trying to get my regular expressions working in the PDE using match()and wasn't getting any success at all. Eventually i tried the exact example in the documentation

Code:

String s = "Inside a tag, you will find content.";
String[] m = match(s, "(\S+)");
println("Found " + m[0] + " inside the tag.");


This didn't work either. The error is "Unexpected char: 'S'".  Was having all sorts of problems with other expressions but from this it seems like it's a bit broken.

Any ideas?

Re: match() bug
Reply #1 - Feb 14th, 2008, 8:31pm
 
sorry, that's a typo in the reference. it should be \\S not \S.

(edit) actually, that's a bug in the reference converter, which seems to be converting the \\ to a single \. will look into it.
Re: match() bug
Reply #2 - Feb 15th, 2008, 9:31am
 
Cheers fry
Page Index Toggle Pages: 1