Ninjakreborn Posted June 16, 2006 Share Posted June 16, 2006 I am trying to find some regular expressions to check for commas after each word, is there any you know of I tried google searches with no luck, and www.regular-expressions.info doesn't seem to have anything specific either. Link to comment https://forums.phpfreaks.com/topic/12175-regex-for-commas/ Share on other sites More sharing options...
poirot Posted June 16, 2006 Share Posted June 16, 2006 Commas after each word? For what you'd need that? How exactly you want it to match? What is a "word"? Link to comment https://forums.phpfreaks.com/topic/12175-regex-for-commas/#findComment-46399 Share on other sites More sharing options...
Ninjakreborn Posted June 16, 2006 Author Share Posted June 16, 2006 www.funnyemailforwards.com the keywords, I have to validate them to seperate by commas for the database don't I. Link to comment https://forums.phpfreaks.com/topic/12175-regex-for-commas/#findComment-46400 Share on other sites More sharing options...
wildteen88 Posted June 16, 2006 Share Posted June 16, 2006 you can use explode? which will split the keywords up into an array then you can validate each keyword one by one:[code]$keywords = explode(',', $_POST['keywords'];foreach($keywords as $k => $v){ //validate each keyword, $v stores the keyword.}[/code] Link to comment https://forums.phpfreaks.com/topic/12175-regex-for-commas/#findComment-46408 Share on other sites More sharing options...
Ninjakreborn Posted June 16, 2006 Author Share Posted June 16, 2006 ahh, thanks I appreciate it. Link to comment https://forums.phpfreaks.com/topic/12175-regex-for-commas/#findComment-46425 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.