I have an input form that must accept accented characters, for example names in German or Spanish. I tried this regex pattern for matching:
([\u00c0-\u01ffa-zA-Z'-.])+$
And I used this string for input "3Bob". The test should fail because 3 is not in the Unicode range. This pattern works great when I plug it into the online tester at http://www.dotnetcoders.com/web/Learning/Regex/definition.aspx. Unfortunately, I get a match when I use ereg or preg_match. When I take out the Unicode range, the match properly fails. Here is the code I wrote to test it:
echo preg_match("/([\u00c0-\u01ffa-zA-Z'-.])+$/", "3Bob");
Any ideas, or does someone have a better pattern? Thanks in advance.
Kurt Krueger