I have been playing with this all day and can't seem to get it solved. I'm using a regular expression validator on a text box to ensure a hyphenated last name has both names beginning with a Capital letter. My expression so far is: "^[A-Z][a-zA-Z\-']*[a-zA-Z]$"
And it properly test for a single last name that begins (or doesn't begin) with a Capital letter e.g. 'Smith' passes and 'smith' fails as it should. Also 'Smith-' with the hyphen and no following name fails as it should. However 'Smith-jones' passes. I figured
that the easy solution would be to add the group [A-Z] after the asterisk like this "^[A-Z][a-zA-Z\-']*[A-Z][a-zA-Z]$" and it would test for the cap after the hyphen, but it does not. I've tried so many other options and now have run out of options. So I'm
looking for some help. Any suggestions anyone?
Thanks
Gary
Go to the complete details ...