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

  • Thread starter Thread starter i_robot73
  • Start date Start date
I

i_robot73

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.
 
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
 
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,
        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!
 
Back
Top