Help Changing RegEx to return a range of numbers

Currently, this expression "I ([a-zA-z]\d]{3} "

returns when the following pattern is executed:

I AAA 
I Z99 

I need to change this so that it returns a range of alphanumeric characters after i from 2 to 13 that have no space.

Example:

I AAA 
I A321 
I ASHG310310 

Thank,

Dave

0


source to share


2 answers


Without quotes:



"I ([a-zA-Z \ d] {2,13})"
+7


source


The parentheses {} allow you to separate a comma between two parameters, which indicates the minimum and maximum number of repetitions. Also, I'm not sure if your original regex gets what you intend - as written, it takes 3 letter groups and a number.

You might want to try



I ([a-zA-Z]|\d){2,13}

      

There is a link here: http://www.regular-expressions.info/reference.html

+2


source







All Articles