newbtophp Posted December 10, 2009 Share Posted December 10, 2009 Im having alittle trouble: [A-Za-z] I have the above regex to match letters, however they dont match special character letters like: ÿ Quote Link to comment https://forums.phpfreaks.com/topic/184579-preg-special-letters/ Share on other sites More sharing options...
Brandon_R Posted December 10, 2009 Share Posted December 10, 2009 You will have to insert the unicode representative for that character in the character class if (preg_match('#[A-Z\x{00FF}]#iu', $text)) { echo 'Match Found'; } else { echo 'Match No Found'; } Quote Link to comment https://forums.phpfreaks.com/topic/184579-preg-special-letters/#findComment-974421 Share on other sites More sharing options...
cags Posted December 10, 2009 Share Posted December 10, 2009 Or depending on which characters you wish to accept you could probably use a script. Quote Link to comment https://forums.phpfreaks.com/topic/184579-preg-special-letters/#findComment-974651 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.