473,326 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

anyone good with custom validators?

Hi I need a custom validator formula for the following

3 letters, a hyphen,3 letters, a hyphen, 4 letters, a hyphen, 5 numbers, a
hyphen,
4 numbers.
so it would validate something like
ABC-DCD-HGDA-12345-4321

I want letters caps.
thanks.
--
Paul G
Software engineer.
Nov 19 '05 #1
4 1068
use a RegularExpressionValidator with the following expression:

[A-Z]{3}\-[A-Z]{3}\-[A-Z]{4}\-\d{5}\-\d{4}

It could be made more compact...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:7D**********************************@microsof t.com...
Hi I need a custom validator formula for the following

3 letters, a hyphen,3 letters, a hyphen, 4 letters, a hyphen, 5 numbers, a
hyphen,
4 numbers.
so it would validate something like
ABC-DCD-HGDA-12345-4321

I want letters caps.
thanks.
--
Paul G
Software engineer.

Nov 19 '05 #2
Hi thanks for the response. I came up with this by doing a search on the
internet, seems to be working, not
sure if I need the ^ character in the beginning though and not sure what the
\ does.
^[A-Z]{3}-[A-Z]{3}-[A-Z]{4}-[0-9]{5}-[0-9]{4}

"Karl Seguin" wrote:
use a RegularExpressionValidator with the following expression:

[A-Z]{3}\-[A-Z]{3}\-[A-Z]{4}\-\d{5}\-\d{4}

It could be made more compact...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:7D**********************************@microsof t.com...
Hi I need a custom validator formula for the following

3 letters, a hyphen,3 letters, a hyphen, 4 letters, a hyphen, 5 numbers, a
hyphen,
4 numbers.
so it would validate something like
ABC-DCD-HGDA-12345-4321

I want letters caps.
thanks.
--
Paul G
Software engineer.


Nov 19 '05 #3
^ means from the beginning
$ means to the end

I _think_ RegularExpressionValidator applies those by default, but it's just
lazy of me to leave them out. - can be a special character so I thought it
should be escaped, you might not HAVE to though. \d is the same as [0-9]

either one should work :)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:D3**********************************@microsof t.com...
Hi thanks for the response. I came up with this by doing a search on the
internet, seems to be working, not
sure if I need the ^ character in the beginning though and not sure what
the
\ does.
^[A-Z]{3}-[A-Z]{3}-[A-Z]{4}-[0-9]{5}-[0-9]{4}

"Karl Seguin" wrote:
use a RegularExpressionValidator with the following expression:

[A-Z]{3}\-[A-Z]{3}\-[A-Z]{4}\-\d{5}\-\d{4}

It could be made more compact...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:7D**********************************@microsof t.com...
> Hi I need a custom validator formula for the following
>
> 3 letters, a hyphen,3 letters, a hyphen, 4 letters, a hyphen, 5
> numbers, a
> hyphen,
> 4 numbers.
> so it would validate something like
> ABC-DCD-HGDA-12345-4321
>
> I want letters caps.
> thanks.
> --
> Paul G
> Software engineer.


Nov 19 '05 #4
ok,Thanks for the additional information.
"Karl Seguin" wrote:
^ means from the beginning
$ means to the end

I _think_ RegularExpressionValidator applies those by default, but it's just
lazy of me to leave them out. - can be a special character so I thought it
should be escaped, you might not HAVE to though. \d is the same as [0-9]

either one should work :)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:D3**********************************@microsof t.com...
Hi thanks for the response. I came up with this by doing a search on the
internet, seems to be working, not
sure if I need the ^ character in the beginning though and not sure what
the
\ does.
^[A-Z]{3}-[A-Z]{3}-[A-Z]{4}-[0-9]{5}-[0-9]{4}

"Karl Seguin" wrote:
use a RegularExpressionValidator with the following expression:

[A-Z]{3}\-[A-Z]{3}\-[A-Z]{4}\-\d{5}\-\d{4}

It could be made more compact...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:7D**********************************@microsof t.com...
> Hi I need a custom validator formula for the following
>
> 3 letters, a hyphen,3 letters, a hyphen, 4 letters, a hyphen, 5
> numbers, a
> hyphen,
> 4 numbers.
> so it would validate something like
> ABC-DCD-HGDA-12345-4321
>
> I want letters caps.
> thanks.
> --
> Paul G
> Software engineer.


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike P | last post by:
Why do the validation server controls behave differently on my live site from on my local development machine? I have several text boxes that are validated by Required Validators and a couple of...
2
by: Pham Nguyen | last post by:
Has anyone seen an example of a textbox server control that has built-in client-side validation? I'd like to build a server control that extends the System.Web.UI.WebControls.TextBox class to allow...
2
by: Rob | last post by:
I am developing an intranet application, that has to pass interanl security audit. The framework version that I am using is .Net framework version 1.1. Some combinations of text entered in any text...
6
by: jk | last post by:
Looking through WebUIValidation.js, I discovered that the standard validators don't cater for non-numeric date formats (e.g. dd-MMM-yyyy) which I would like to do To keep code to a minimum, I...
5
by: Jason | last post by:
I am able fire my field validators in FireFox on the server side using... Page.Validate() If Not Page.IsValid Then Exit Sub End If But the it won't fire Custom Validators. Anybody know why?
5
by: Mattyw | last post by:
Hi, I'm relatively new to Web Forms, I have been using Required Field Validators and Regular Expression Validators on a Web Form I am developing and everything works as expected using Visual...
4
by: Rick | last post by:
Hello, I built a composite web control that has a textbox and a date control. added my custom control on a webform where there are other standard controls. Each control on the form has a...
1
gagandeepgupta16
by: gagandeepgupta16 | last post by:
Hi I am working on an entry form using validation controls in ASP.NET. I have two controls which requires custom validators, no issue in using plain custom validators. But when i am using...
1
by: Steveaux | last post by:
Hi, I'm new to ASP.Net, so this may be something simple that I forgot. I have a form where a person can create a login. I'm doing the processing on this myself. The form has a plethora of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.