OT: Regular expression help

C

catherine

Hi, I need to clean up some data so I need some help with a regular
expression

Basically the dud info can be either a large int or a large int with a
single character attached to the front of it.

e.g.

77232323
or
E8833434
or
Z3344343

What I would like is an expression which would look for all numbers
which are longer than three characters long OR have more than three
numbers in the string and also have a single character as the first
character in the string.

Thanks for any help
Cath
 
A

Alberto Poblacion

Hi, I need to clean up some data so I need some help with a regular
expression

Basically the dud info can be either a large int or a large int with a
single character attached to the front of it.

e.g.

77232323
or
E8833434
or
Z3344343

What I would like is an expression which would look for all numbers
which are longer than three characters long OR have more than three
numbers in the string and also have a single character as the first
character in the string.

If I have understood correctly what you want, this should do it:

RegEx Re = new RegEx(@"^[A-Z]?\d{3,}$");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top