Hi,
I created an HTA that requires First Name, Last Name, and username to be entered. I am working on the First Name validation first.
The First Name should only be alpha characters but may include a hyphen. No numbers or symbols (besides hyphen) should be found in any position of the string being tested. I did find one user with a hyphen in the first name though so I need to allow that symbol. My approach has been to look for matches that are not alpha characters. If there is a match, I display a warning that tells the user to enter only alpha characters. Here is the regex pattern that I am testing:
[^a-zA-Z]+$
When I test this pattern, it is unable to detect a number or symbol (including hyphen) if it is in any position other than the end of the string. The pattern I posted here doesn't allow for a hyphen so I need to fix that as well.
What should this regex pattern look like if I want to detect anything other than an alpha character regardless of where it occurs in the string being tested?
Thanks,
Rob
I created an HTA that requires First Name, Last Name, and username to be entered. I am working on the First Name validation first.
The First Name should only be alpha characters but may include a hyphen. No numbers or symbols (besides hyphen) should be found in any position of the string being tested. I did find one user with a hyphen in the first name though so I need to allow that symbol. My approach has been to look for matches that are not alpha characters. If there is a match, I display a warning that tells the user to enter only alpha characters. Here is the regex pattern that I am testing:
[^a-zA-Z]+$
When I test this pattern, it is unable to detect a number or symbol (including hyphen) if it is in any position other than the end of the string. The pattern I posted here doesn't allow for a hyphen so I need to fix that as well.
What should this regex pattern look like if I want to detect anything other than an alpha character regardless of where it occurs in the string being tested?
Thanks,
Rob