[hibernate-issues] [Hibernate-JIRA] Created: (HV-14) Minor typo in regular expression in class EmailValidator

Talal Al-Tamimi (JIRA) noreply at atlassian.com
Sat Apr 28 05:44:04 EDT 2007


Minor typo in regular expression in class EmailValidator
--------------------------------------------------------

                 Key: HV-14
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-14
             Project: Hibernate Validator
          Issue Type: Bug
          Components: validators
    Affects Versions: 3.0.0.ga
            Reporter: Talal Al-Tamimi
            Priority: Trivial


It looks like there is a small mistake in the regular expression below from class EmailValidator:

private static String ATOM = "[^\\x00-\\x1F^\\(^\\)^\\<^\\>^\\@^\\,^\\(;^\\:^\\\\^\\\"^\\.^\\[^\\]^\\s]";

The substring to exclude a semicolon should be "^\\;" but above it is shown as "^\\(;"
Instead of excluding a semicolon, this will exclude the left parenthesis (which is already done earlier in the regular expression) and allow a semicolon.

Also, the initialize method is instantiating instance variable 'pattern' twice. The first seems to be an older line of code, so it might be a good idea to comment it out. This is not a bug though, since the first instance is just discarded.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list