It's all about the answers!

Ask a question

Regular expression validator


Gowra chandra varma (11136) | asked Jun 27 '12, 2:40 a.m.
Hi,
I have few attributes of data type "string", i want user to enter only numeric values (0 to 9) into them. I am looking for a regular expression validator.

I tried "[0-9]{8}" , but with this user should compulsory give 8 numeric values, my requirement is "user should be able to enter any number of values (max 10 & min 1)"

Pls share the expression through which i can achieve that

Accepted answer


permanent link
Muthukumar C (32712733) | answered Jun 27 '12, 8:59 a.m.
Hi,

Here is what you want.

[1-9]{1,10} --> Miminum Digits , Maximum Digits

Regards
Muthukumar.C
Ralph Schoon selected this answer as the correct answer

Comments
Karen Steele commented Nov 04 '15, 9:31 a.m.

Can you please advise if this works for characters too .. have the same requirement but for a string that is both letters and numbers would it be [A-Z]{1,10}

Your answer


Register or to post your answer.