Bad character class exception on pattern that works for JDK's Pattern class
Jim K <[email protected]> Tue, 10 Oct 2006 19:26:38 +0000 (UTC)
| Newsgroups | gmane.comp.jakarta.regexp.user |
|---|---|
| Message-ID | <[email protected]> |
I'd like to use a email validation pattern that I came across on a Perl users
board. It works just fine with Java's regex.Pattern class but fails to compile
when using Apache Regexp. The RECompiler class returns a Bad character
exception.
The pattern I'm trying to use is:
^([0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]
{2,9})$
If I strip out all the groups then RE will accept the pattern. I know that RE
supports groups, but maybe not nested groups?