Regular expression to validate a string
Hi Team
I am looking for a regular expression to match 3 pre-defined values under a simple string attribute of type text.
The requirement is to enter either of the three values:
Required, Not Required, Done
I have written the below expression to validate:
(^|\s)Required|Not Required|Done(\s|$)
This works only for the first value.
If I enter the same value or different value on the new line; it gives me an error.
Please let me know what am I missing here.
Thanks
Rajat
Comments
Rajat Singh
May 06 '16, 6:03 a.m.Managed to get the following expression working
Donald Nong
May 09 '16, 3:07 a.m.Use the "i" switch.
Rajat Singh
May 09 '16, 7:46 a.m.Thanks but it does not work when using \n.
Rajat