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: ÿ 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'; } 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. Link to comment https://forums.phpfreaks.com/topic/184579-preg-special-letters/#findComment-974651 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.