non-capturing group in regex pattern is not working in asset attribute validation

XMLWordPrintable

    • 1
    • Minor

      Issue Summary

      Below regex to validate uncaptured group in email is not working

      ^[A-Za-z0-9._%+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,}(?:,[A-Za-z0-9._%+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,})*$
      

      Steps to Reproduce

      1. Login to instance.
      2. Add below Regex validation to any text or email attribute  and save
        ^[A-Za-z0-9._%+\-]{+}@[A-Za-z0-9.\-]{+}\.[A-Za-z]
        {2,}(?:,[A-Za-z0-9._%+\-]{+}@[A-Za-z0-9.\-]{+}\.[A-Za-z]{2,}
        )*$
        
      1. This behaviour is seen in site with new asset architecture, with old architecture this is working as expected.

      Expected Results

      Regex is valid and is saved 

      Actual Results

      Error : We couldn’t update your attribute
      The format of the regular expression is invalid.

      Workaround

      Currently , removing the uncaptured group and using below regex works -

       [A-Za-z0-9._%+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,}

      but this does not support uncaptured group .

       A workaround for captured group  will be added here when available

            Assignee:
            Sowkot Osman
            Reporter:
            Deepika Rai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: