Regular expression confusion...

  • Thread starter Thread starter Tom Jones
  • Start date Start date
T

Tom Jones

I don't understand how to construct the following regex:

I need to match a word that is made of up alphas and ends with an optional
',' character.

For example:

ValidWord
ValidWord,
NotValid7
Not7Valid
NotValid7,

I thought that [a-zA-Z]+,? would work but it doesn't, it matches the
"NotValid" part of "NotValid7" (the seven should disqualify that sequence of
characters...

What am I missing!?

Thanks,
TJ
 
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/vsintro7/html/vxgrfRegularExp
ressionsS.htm


[a-zA-Z]+,?>
 
Back
Top