Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-2127

Limitations of the regexp validator prevents email validation

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 5.0.9
    • Fix Version/s: None
    • Component/s: Framework
    • Labels:
      None

      Description

      I'm using regexp validation constraint to enable email validation, however since regular expresion may contain "," regexp parsing failing with exception

      My regexp annotation:

      @Validate("required,regexp=([A-Za-z0-9][._-]*)[A-Za-z0-9]@([A-Za-z0-9-]
      .)+[A-Za-z]

      {2,6}

      ")
      public String getEmail()

      { return email; }

      Exception is:

      Caused by: java.util.regex.PatternSyntaxException: Unclosed counted closure near index 62
      ([A-Za-z0-9][._-]*)[A-Za-z0-9]@([A-Za-z0-9-]\.)+[A-Za-z]{2
      ^
      at java.util.regex.Pattern.error(Pattern.java:1650)
      at java.util.regex.Pattern.closure(Pattern.java:2690)
      at java.util.regex.Pattern.sequence(Pattern.java:1798)
      at java.util.regex.Pattern.expr(Pattern.java:1687)
      at java.util.regex.Pattern.compile(Pattern.java:1397)
      at java.util.regex.Pattern.<init>(Pattern.java:1124)
      at java.util.regex.Pattern.compile(Pattern.java:817)
      at org.apache.tapestry.services.TapestryModule$9.coerce(TapestryModule.java:639)
      at org.apache.tapestry.services.TapestryModule$9.coerce(TapestryModule.java:637)
      at org.apache.tapestry.ioc.services.CoercionTuple$CoercionWrapper.coerce(CoercionTuple.java:53)

        Attachments

        1. Picture 1.png
          21 kB
          Renat Zubairov

          Activity

            People

            • Assignee:
              hlship Howard M. Lewis Ship
              Reporter:
              zubairov Renat Zubairov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: