mpsn Posted February 25, 2012 Share Posted February 25, 2012 Hi, Does ",[a-zA-Z0-9]$" => a comma, followed by any alphanumeric as last character, so I don't really need '$' anchor, right? Quote Link to comment https://forums.phpfreaks.com/topic/257774-preg-ques/ Share on other sites More sharing options...
AyKay47 Posted February 25, 2012 Share Posted February 25, 2012 well, without the string ending anchor. A string like ",hey whats up" would match. If you want the alphanumeric character preceded by the comma to be the only match, then yes you need the ending anchor. Quote Link to comment https://forums.phpfreaks.com/topic/257774-preg-ques/#findComment-1321215 Share on other sites More sharing options...
mpsn Posted February 25, 2012 Author Share Posted February 25, 2012 I can't find the pattern characters for digits, letters, whitespace, non-whitespace on official php site, like I think d is for numbers, but how about the rest. Quote Link to comment https://forums.phpfreaks.com/topic/257774-preg-ques/#findComment-1321229 Share on other sites More sharing options...
AyKay47 Posted February 25, 2012 Share Posted February 25, 2012 \d = digits [0-9] [a-zA-Z] = letters (case insensitive) [\s\t] = white space (matches a space and tab respectfully) [^\s\t] = non-white space (matches anything other than the above white space characters) what does this have to do with your original question? Quote Link to comment https://forums.phpfreaks.com/topic/257774-preg-ques/#findComment-1321253 Share on other sites More sharing options...
mpsn Posted February 25, 2012 Author Share Posted February 25, 2012 my bad, I should have made new post. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/257774-preg-ques/#findComment-1321265 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.