Click here to Skip to main content
15,861,125 members
Home / Discussions / Regular Expressions
   

Regular Expressions

 
SuggestionRe: Help with regex HTML form validation Part 2 Pin
Matt T Heffron10-Oct-14 13:18
professionalMatt T Heffron10-Oct-14 13:18 
GeneralRe: Help with regex HTML form validation Part 2 Pin
robwm110-Oct-14 13:19
robwm110-Oct-14 13:19 
GeneralRe: Help with regex HTML form validation Part 2 Pin
robwm111-Oct-14 11:00
robwm111-Oct-14 11:00 
GeneralRe: Help with regex HTML form validation Part 2 Pin
Matt T Heffron13-Oct-14 6:37
professionalMatt T Heffron13-Oct-14 6:37 
GeneralRe: Help with regex HTML form validation Part 2 Pin
robwm113-Oct-14 6:59
robwm113-Oct-14 6:59 
AnswerRe: Help with regex HTML form validation Part 2 Pin
Matt T Heffron10-Oct-14 13:15
professionalMatt T Heffron10-Oct-14 13:15 
GeneralRe: Help with regex HTML form validation Part 2 Pin
robwm110-Oct-14 13:18
robwm110-Oct-14 13:18 
QuestionHelp with regex HTML form validation Pin
robwm19-Oct-14 12:35
robwm19-Oct-14 12:35 
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

modified 9-Oct-14 19:04pm.

AnswerRe: Help with regex HTML form validation Pin
George Jonsson9-Oct-14 16:26
professionalGeorge Jonsson9-Oct-14 16:26 
SuggestionRe: Help with regex HTML form validation Pin
Richard Deeming9-Oct-14 22:27
mveRichard Deeming9-Oct-14 22:27 
GeneralRe: Help with regex HTML form validation Pin
George Jonsson9-Oct-14 23:14
professionalGeorge Jonsson9-Oct-14 23:14 
GeneralRe: Help with regex HTML form validation Pin
robwm110-Oct-14 6:03
robwm110-Oct-14 6:03 
AnswerRe: Help with regex HTML form validation Pin
Richard Deeming9-Oct-14 22:33
mveRichard Deeming9-Oct-14 22:33 
GeneralRe: Help with regex HTML form validation Pin
robwm110-Oct-14 6:11
robwm110-Oct-14 6:11 
GeneralRe: Help with regex HTML form validation Pin
Richard Deeming10-Oct-14 7:35
mveRichard Deeming10-Oct-14 7:35 
GeneralRe: Help with regex HTML form validation Pin
robwm110-Oct-14 7:39
robwm110-Oct-14 7:39 
GeneralRe: Help with regex HTML form validation Pin
Richard Deeming10-Oct-14 7:47
mveRichard Deeming10-Oct-14 7:47 
QuestionRegular expression date Pin
Member 836446830-May-14 7:27
Member 836446830-May-14 7:27 
QuestionRe: Regular expression date Pin
George Jonsson13-Sep-14 23:21
professionalGeorge Jonsson13-Sep-14 23:21 
AnswerRe: Regular expression date Pin
nagshead_obx9-Oct-14 7:10
nagshead_obx9-Oct-14 7:10 
QuestionRe: Regular expression date Pin
George Jonsson9-Oct-14 16:18
professionalGeorge Jonsson9-Oct-14 16:18 
QuestionRegex to extact lines of code know the start and ending Pin
susanab17-Apr-14 3:25
susanab17-Apr-14 3:25 
QuestionRe: Regex to extact lines of code know the start and ending Pin
Matt T Heffron17-Apr-14 8:14
professionalMatt T Heffron17-Apr-14 8:14 
Question[Solved] Pin
Marco Bertschi20-Mar-14 4:10
protectorMarco Bertschi20-Mar-14 4:10 
GeneralRe: A little help needed... Pin
Marco Bertschi20-Mar-14 5:24
protectorMarco Bertschi20-Mar-14 5:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.