ryanfilard Posted September 14, 2012 Share Posted September 14, 2012 I am trying to make a chat bot with preg_match but how would I go about scanning a sentence for hello, hi, and how are you? Link to comment https://forums.phpfreaks.com/topic/268391-preg_match-help/ Share on other sites More sharing options...
.josh Posted September 15, 2012 Share Posted September 15, 2012 you don't need preg_match for this, you can use stripos Link to comment https://forums.phpfreaks.com/topic/268391-preg_match-help/#findComment-1378046 Share on other sites More sharing options...
ManiacDan Posted September 15, 2012 Share Posted September 15, 2012 You also probably shouldn't be making a chat bot in PHP unless the rest of the system is also PHP. Link to comment https://forums.phpfreaks.com/topic/268391-preg_match-help/#findComment-1378047 Share on other sites More sharing options...
.josh Posted September 15, 2012 Share Posted September 15, 2012 hey now, I made an irc bot in php! Link to comment https://forums.phpfreaks.com/topic/268391-preg_match-help/#findComment-1378050 Share on other sites More sharing options...
ManiacDan Posted September 15, 2012 Share Posted September 15, 2012 Quote hey now, I made an irc bot in php! Yes, you're out of your mind, this is common knowledge. Why did you choose PHP instead of Perl? Most IRC bots I've used are Perl based. Chat parsing is kind of why Perl exists. Link to comment https://forums.phpfreaks.com/topic/268391-preg_match-help/#findComment-1378059 Share on other sites More sharing options...
.josh Posted September 15, 2012 Share Posted September 15, 2012 Because this is phpfreaks, not perlfreaks. Though admittedly the latter rolls of the tongue better... Link to comment https://forums.phpfreaks.com/topic/268391-preg_match-help/#findComment-1378074 Share on other sites More sharing options...
hakimserwa Posted September 15, 2012 Share Posted September 15, 2012 whats his problem Link to comment https://forums.phpfreaks.com/topic/268391-preg_match-help/#findComment-1378154 Share on other sites More sharing options...
Pikachu2000 Posted September 15, 2012 Share Posted September 15, 2012 Quote whats his problem What is whose problem? Link to comment https://forums.phpfreaks.com/topic/268391-preg_match-help/#findComment-1378189 Share on other sites More sharing options...
ryanfilard Posted September 15, 2012 Author Share Posted September 15, 2012 I like a challenge so I choose PHP. Link to comment https://forums.phpfreaks.com/topic/268391-preg_match-help/#findComment-1378220 Share on other sites More sharing options...
ManiacDan Posted September 16, 2012 Share Posted September 16, 2012 Quote Because this is phpfreaks, not perlfreaks. Though admittedly the latter rolls of the tongue better... Fair enough! I do a lot of text parsing in PHP (web spiders, mostly), but for some reason I would never use it for something like a chat bot. I always fall back to perl, even though I write my spiders in PHP. Link to comment https://forums.phpfreaks.com/topic/268391-preg_match-help/#findComment-1378283 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.