Our new Appfire Documentation Space is now live!

Take a look here! If you have any questions please email support@appfire.com

How to validate input values in the text field that are separated by comma with regular expression

Use cases:

  • Regex to validate input values separate by a comma in the single-line text field

  • Regex to validate input values of a certain range that are separated by a comma in the single-line text field

  • Regex to validate input values that has special characters included and are separated by a comma in the single-line text field

Instructions

Please note, the steps added below are on the Create Issue transition. The validator can be added anywhere on the workflow transition according to the requirement.

  1. Select the Create Issue transition.

  2. Select the Validators tab and click Add validator

  3. Select Regular Expression Check (JSU) validator and click Add

  4. Select the field of the type text field (Single line).

  5. In the Regular expression field: Enter the regular expression as mentioned below:

    ([a-z0-9A-Z\s_]+,)*([a-z0-9A-Z\s_]+)


    The best practice is to test the regular expression here https://www.freeformatter.com/java-regex-tester.html, before entering the same in the validator.


    To limit the input values to a maximum length of 40 characters, the below regular expression can be used:

    ([a-z0-9A-Z\s_]{0,40},)*([a-z0-9A-Z\s_]{0,40})

     

     

  6. Enter a message in the Error message(optional) text box, which will be displayed on the screen, if the validation fails or the field is left empty.

     

  7. Click Add and Publish the workflow.

  8. Create an issue by providing the input values in the text field(single line), thus it validates!