Forums

Help for Regular expression code

gabi 02 Jul, 2022
I am using Regular expression to validate a field in my form.
/^BLDCT-000[1-5]$/

Means you have to enter one of 5 strings in the field:
BLDCT-0001
BLDCT-0002
BLDCT-0003
BLDCT-0004
BLDCT-0005

Now I want to use and validate other numbers, but I have no idea how to change the code:
New strings/numbers are:
BLDCT-0006
BLDCT-0007
BLDCT-0008
BLDCT-0009
BLDCT-0010

Can someone please help me get this working if possible.
How should the new code look like?
Colnem 03 Jul, 2022
Hi

Don't use a Text Field with validate expression. Use a dropdown field with list of your values.
gabi 04 Jul, 2022
Would be easier, I agree, but it is about a gift card number and I don't want to deliver informations about the number.
Thanks for answer anyway.
gabi 04 Jul, 2022
Thank you very much for your help.
Got it working like this:

/^BLDCT-000[6-9]|BLDCT-001[0]$/
You need to login to be able to post a reply.