Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Regular expression validator

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

0 votes


Accepted answer

Permanent link
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

1 vote

Comments

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 log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 7,495
× 6,121
× 1,700

Question asked: Jun 27 '12, 2:40 a.m.

Question was seen: 5,032 times

Last updated: Nov 04 '15, 10:06 a.m.

Confirmation Cancel Confirm