Regex constraint to validate alphanumeric

(Narendra S Thakuri) #1

I am trying to use RegEx to validate alphanumeric value.
Constraint = “regex(.,('^[A-Z0-9]0[1-9]demogForm.xlsx (17.6 KB)

(Dr. Gareth S. Bestor) #2

Can you describe or post some examples of what strings you are trying to check. Your regex looks like a valid regex expression, but without some test cases it’s not possible to determine if it’s fit for purpose. Thnx

(Narendra S Thakuri) #3

I would like to check alphanumeric character ranges.
a) 001-999 Or.
b) A01-A99

(Dr. Gareth S. Bestor) #4

regex(., '^[0-9]{3}$')

regex(., '^[A-Z][0-9]{2}$')

(assuming you want to allow prefix letters other than 'A') :slight_smile:

I highly recommend hopping on somewhere like and playing around. It’s simple to try out different regex expressions against data you type in, and finding out in real-time what does/not work is a great way to learn the seemingly indecipherable language of regular expressions.

(Narendra S Thakuri) #5

Thanks Xiphware for your help.