regex accept nine digits and accepts more then 1 number

Shashi Kumar September 13, 2017

I need a regex/a solution for a field which accepts only 9 digits and should accept more than one number are separated by semicolon 

Eg: 123456789;012365478;987456321

 I could do only 1 with this expression {0-9]{9} as setting this in condition

This would a great help

1 answer

0 votes
somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 14, 2017

Hi Shashi,

I'm a bit unclear on what exactly you're looking for but from the description I believe you're looking for an expression to validate there's only 9 characters one that will take multiple inputs separated by semicolon.  The following should do it:

 

[0-9]{9}+(;[0-9]{9}+)*

The first part is the first match and then it matches semicolon-number string and repeats.

Cheers,

Branden

Shashi Kumar September 14, 2017

 

Thanks for response @Branden McElveen though I was unclear. you have got what I needed..will try this and let you know...

Thanks once again
Shashi

Shashi

Suggest an answer

Log in or Sign up to answer