473,324 Members | 2,124 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,324 software developers and data experts.

Reg Expression for validation (NOT using the Validation components??)

I have an ASP .NET (in C# of course :P) that has 4 input boxes:

Group (9-digits, EG: 123456789)
F. Name (EG: Paul)
L. Name (EG: Simpson)
LogonID (5678_PSimpson)
[1st four of the last 5 digits of the Group number, 1st is NEVER
a '0' (zero)]

I'm using the 'RegularExpressionValidator' (ClientScript = Enable) on
the Group ("\d{9}") & name parts ("^[a-zA-Z][a-zA-Z]*$") but can't for
the life of me figure how to:

) Validate the LogonID if all 3 pieces are supplied
a. client or server side?
b. What IS the reg. expression I'd need to use? ("^[1-9][0-9]
{4}__[a-zA-z]*") <-- NO GOOD
I've been reading you can 'name' the groups.....does .NET allow it??
Can I name the <LName& use it in the LogonID validation??

Pretty new to programming in general, so be easy :)

Thanks again for the help,

David D.
Sep 9 '08 #1
2 1235
On Sep 9, 9:41*pm, i_robo...@hotmail.com wrote:
I have an ASP .NET (in C# of course :P) that has 4 input boxes:

Group (9-digits, EG: *123456789)
F. Name (EG: *Paul)
L. Name (EG: *Simpson)
LogonID (5678_PSimpson)
* * *[1st four of the last 5 digits of the Group number, 1st is NEVER
a '0' (zero)]

I'm using the 'RegularExpressionValidator' (ClientScript = Enable) on
the Group ("\d{9}") & name parts ("^[a-zA-Z][a-zA-Z]*$") but can't for
the life of me figure how to:

) Validate the LogonID if all 3 pieces are supplied
* * *a. client or server side?
* * *b. What IS the reg. expression I'd need to use? *("^[1-9][0-9]
{4}__[a-zA-z]*") <-- NO GOOD

I've been reading you can 'name' the groups.....does .NET allow it??
Can I name the <LName& use it in the LogonID validation??

Pretty new to programming in general, so be easy :)

Thanks again for the help,

David D.
David,
As far as I know the below regular expression should suffice.

LoginID
^[1-9][0-9]{3}_[a-zA-Z]+$

For Fname and Lname
^[a-zA-Z]+$

For validating group
^\d{9}$

Ensure you are trimming left and right white spaces before validating.

I don't know of a way if by using regular expression if is possible to
pass the output of one regex to another.
You may have to right code for that.

The above regexes will just validate the syntaxes of you input.

Regards,
Shree
Sep 11 '08 #2
On Sep 11, 5:29*am, Shree <Shree.S.Jo...@gmail.comwrote:
On Sep 9, 9:41*pm, i_robo...@hotmail.com wrote:


I have an ASP .NET (in C# of course :P) that has 4 input boxes:
Group (9-digits, EG: *123456789)
F. Name (EG: *Paul)
L. Name (EG: *Simpson)
LogonID (5678_PSimpson)
* * *[1st four of the last 5 digits of the Group number, 1st is NEVER
a '0' (zero)]
I'm using the 'RegularExpressionValidator' (ClientScript = Enable) on
the Group ("\d{9}") & name parts ("^[a-zA-Z][a-zA-Z]*$") but can't for
the life of me figure how to:
) Validate the LogonID if all 3 pieces are supplied
* * *a. client or server side?
* * *b. What IS the reg. expression I'd need to use? *("^[1-9][0-9]
{4}__[a-zA-z]*") <-- NO GOOD
I've been reading you can 'name' the groups.....does .NET allow it??
Can I name the <LName& use it in the LogonID validation??
Pretty new to programming in general, so be easy :)
Thanks again for the help,
David D.

David,
* * * * As far as I know the below regular expression should suffice.

LoginID
^[1-9][0-9]{3}_[a-zA-Z]+$

For Fname and Lname
^[a-zA-Z]+$

For validating group
^\d{9}$

Ensure you are trimming left and right white spaces before validating.

I don't know of a way if by using regular expression if is possible to
pass the output of one regex to another.
You may have to right code for that.

The above regexes will just validate the syntaxes of you input.

Regards,
Shree- Hide quoted text -

- Show quoted text -
Do appreciate the feedback. On the right track @ least :) Thanks
again!
Sep 22 '08 #3

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

Similar topics

2
by: Bryce Budd | last post by:
Hi all, I am trying to use a regular expression validator to check for the existence of PO Box in an address textbox. The business rule is "No addresses with PO Boxes are allowed." What I...
9
by: Stirling | last post by:
Hi all, hope someone can help me, I am looking to do a password validation check using client side validation. Minimum requirement is that it must contain at least one number and one letter. ...
5
by: JIM.H. | last post by:
Hello, I have this validation expression: ^(?:(?:0?|1)|(?:0?|11)(?!\/31)|(?:0?2)(?:(?!\/3|\/29\/(?:(?:0||)00|(?:\d{2}(?:0||))))))\/(?:0?||3)\/\d{4}$ This is supposed to match MM/DD/YYYY it is...
18
by: Q. John Chen | last post by:
I have Vidation Controls First One: Simple exluce certain special characters: say no a or b or c in the string: * Second One: I required date be entered in "MM/DD/YYYY" format: //+4 How...
2
by: Tim Frawley | last post by:
Source code attached indicates my problem with validation and a button bar save button. Fill the Textbox with some text then tab off the control. The message box will display the text in the...
5
by: Micky | last post by:
VB v7.1.3088 NET v1.1.4322 SP1 My mate has a strange problem regarding the ESC key and validation. When he hits the Cancel button on his form, the form does not validate. This is correct...
5
by: shawnmkramer | last post by:
Anyone every heard of the Regex.IsMatch and Regex.Match methods just hanging and eventually getting a message "Requested Service not found"? I have the following pattern: ^(?<OrgCity>(+)+),...
18
by: Lit | last post by:
Hi, I am looking for a Regular expression for a password for my RegExp ValidationControl Requirements are, At least 8 characters long. At least one digit At least one upper case character
2
by: Joey | last post by:
Hello guys, I'm trying to learn about regular expressions. I need to be able to use an RE that can evaluate for STRINGS (or specific sequences of characters), not just occurances of characters....
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
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.