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,777
Messages
2,569,604
Members
45,208
Latest member
RandallLay

Latest Threads

Top