View Single Post
  #2 (permalink)  
Old 08-07-2007, 07:36 AM
barney barney is offline
Member
 
Join Date: Jul 2007
Posts: 40
barney is on a distinguished road
The regex I used was
Code:
[a-zA-Z]{2,}[a-zA-Z ']* It seemed to work: Ouch this totally 'sux0rz - false (numbers) Ouch this totally 'sux.rz - false (improper character) Ouch this totally 'suxorz - true a - false (not enough beginning letters) a' - false (not enough beginning letters) a ' - false (not enough beginning letters) a b' - false (not enough beginning letters) a'b - false (not enough beginning letters) ab' - true ab ' - true
The reason that you were having problems is because you weren't allowing for letters after a space or after an apostrophe. The regex string you created assumes that there is no input other than a space or an apostrophe after a space or an apostrophe.
Greetings.
Reply With Quote