tyra Posted March 8, 2010 Share Posted March 8, 2010 return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $t1); how to add "post" and "topic" in preg_mach? and how to check them with OR ? Link to comment https://forums.phpfreaks.com/topic/194494-match-help/ Share on other sites More sharing options...
salathe Posted March 8, 2010 Share Posted March 8, 2010 preg_post_topic_mach Link to comment https://forums.phpfreaks.com/topic/194494-match-help/#findComment-1022974 Share on other sites More sharing options...
tyra Posted March 8, 2010 Author Share Posted March 8, 2010 anybody ? Link to comment https://forums.phpfreaks.com/topic/194494-match-help/#findComment-1022999 Share on other sites More sharing options...
tyra Posted March 8, 2010 Author Share Posted March 8, 2010 "post" or "topic" comes right after domain.com/ Link to comment https://forums.phpfreaks.com/topic/194494-match-help/#findComment-1023080 Share on other sites More sharing options...
Anti-Moronic Posted March 8, 2010 Share Posted March 8, 2010 I'd repost this in the regex section and explain - are you looking to match exactly those words or variables which fall under a 'post' or 'topic'. Link to comment https://forums.phpfreaks.com/topic/194494-match-help/#findComment-1023082 Share on other sites More sharing options...
tyra Posted March 9, 2010 Author Share Posted March 9, 2010 Exactly those words. Link to comment https://forums.phpfreaks.com/topic/194494-match-help/#findComment-1023414 Share on other sites More sharing options...
gizmola Posted March 9, 2010 Share Posted March 9, 2010 Have you made any attempt to understand regex at all? If you understand the regex you provided then you should be able to figure out where to put: (post|topic){1} Link to comment https://forums.phpfreaks.com/topic/194494-match-help/#findComment-1023445 Share on other sites More sharing options...
tyra Posted March 9, 2010 Author Share Posted March 9, 2010 so where to put it ? Link to comment https://forums.phpfreaks.com/topic/194494-match-help/#findComment-1023617 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.