kfir91 Posted February 4, 2011 Share Posted February 4, 2011 else if( !preg_match("/([a-zA-Z0-9א-ת-])*[,]([a-zA-Z0-9א-ת-])+$/", $tags)) i wanted to doing format : word,word,word,word...etc but its not working i want word comma word comma word its the format and only one comma not word,,word,word,word Quote Link to comment https://forums.phpfreaks.com/topic/226671-problem-with-format-preg_match/ Share on other sites More sharing options...
.josh Posted February 4, 2011 Share Posted February 4, 2011 umm...what? Quote Link to comment https://forums.phpfreaks.com/topic/226671-problem-with-format-preg_match/#findComment-1169881 Share on other sites More sharing options...
icez Posted February 6, 2011 Share Posted February 6, 2011 [,]{1} Quote Link to comment https://forums.phpfreaks.com/topic/226671-problem-with-format-preg_match/#findComment-1170560 Share on other sites More sharing options...
sasa Posted February 7, 2011 Share Posted February 7, 2011 try <?php $test = 'sasa,,word7,bond007'; if(preg_match('/((^|[^a-z0-9]),)|(,([^a-z0-9]|$))/i', $test)) echo 'No'; else echo 'OK'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/226671-problem-with-format-preg_match/#findComment-1171083 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.