Author Login
Post Reply
I'm not new to regex, but new to Groovy. Please help, why won't the following
code match what I want?
The valid characters are A-Z, a-z, spaces, period, comma, apostrophe,
hyphen. I want to disqualify anything else.
I started with a simple regex to allow alpha only, but
even that is not working for me. What the heck am I doing wrong??
// mmn = String from posted form
// should match anything that is not alpha
matcher = ( mmn =~ /[^A-Za-z\ \.,'-]/ );
if (matcher.matches()) { //return error message}
--
Sent from the groovy - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email