validation expression is this correct?

G

Guest

Hi I am using a validationexpression with a regular expression validator.
In the properties window for the expression I have
[\D(3)]|[-]|[\D(3)]|[-]|[\D(4)]|[-]|[\d(5)]|[-]|[\d(4)]
as I want the following format,
abc-efg-hijk-12345-6789
abc efg hijk all must be letters upper case, I also need to check for the
hyphens -,
the numbers 123456789 can be any digits.
Anyhow seems like it is not working correctly, thanks.
 
K

Karl Seguin

I think this ought to work:
([A-Z]{3}\-){2}[A-Z]{4}\-\d{5}\-\d{4}

couple problems with your things, first off ( ) is for captures, whereas {}
is for counts...\D will do any non-dights, you only want uppercase letters

Karl
 
G

Guest

ok thanks think that is what I was looking for.

Karl Seguin said:
I think this ought to work:
([A-Z]{3}\-){2}[A-Z]{4}\-\d{5}\-\d{4}

couple problems with your things, first off ( ) is for captures, whereas {}
is for counts...\D will do any non-dights, you only want uppercase letters

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/


Paul said:
Hi I am using a validationexpression with a regular expression validator.
In the properties window for the expression I have
[\D(3)]|[-]|[\D(3)]|[-]|[\D(4)]|[-]|[\d(5)]|[-]|[\d(4)]
as I want the following format,
abc-efg-hijk-12345-6789
abc efg hijk all must be letters upper case, I also need to check for the
hyphens -,
the numbers 123456789 can be any digits.
Anyhow seems like it is not working correctly, thanks.
 

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

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top