I have the regex pattern [A-Za-z' -]{1,50}$ it works fine apart from it doesnt allow ' even though some software im using (The Regex Coach) says it should allow ' (e.g. o'reilly should be ok) but when I try to use it in php it returns an error (my error saying its not allowed). Here is the bit of PHP code im using:
if(preg_match("/^[A-Za-z' -]{1,50}$/",$fname)){
}else{ $dont_send=1; echo "First Name Must be a-z or A-Z only<br />";}
This should allow a-z,A-Z,-,' and spaces but for some reason it wont allow '
Any ideas why this isn't working? Thanks.