Click here to Skip to main content
14,978,864 members
Home / Discussions / Regular Expressions
   

Regular Expressions

 
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
Memberrobwm110-Oct-14 13:18 
QuestionHelp with regex HTML form validation Pin
robwm19-Oct-14 12:35
Memberrobwm19-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
Memberrobwm110-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
Memberrobwm110-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
Memberrobwm110-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
MemberMember 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
Membernagshead_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
Membersusanab17-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
professionalMarco Bertschi20-Mar-14 4:10 
AnswerMessage Closed Pin
20-Mar-14 4:44
professionalPeter Leow20-Mar-14 4:44 
GeneralRe: A little help needed... Pin
Marco Bertschi20-Mar-14 5:24
professionalMarco Bertschi20-Mar-14 5:24 
GeneralRe: A little help needed... Pin
Haloniels19977-Sep-14 11:36
MemberHaloniels19977-Sep-14 11:36 
QuestionRe: A little help needed... Pin
Kornfeld Eliyahu Peter20-Mar-14 4:55
professionalKornfeld Eliyahu Peter20-Mar-14 4:55 
AnswerRe: A little help needed... Pin
Marco Bertschi20-Mar-14 5:21
professionalMarco Bertschi20-Mar-14 5:21 
GeneralRe: A little help needed... Pin
Kornfeld Eliyahu Peter20-Mar-14 5:37
professionalKornfeld Eliyahu Peter20-Mar-14 5:37 

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.