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? Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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! Quote Link to comment Share on other sites More sharing options...
ManiacDan Posted September 15, 2012 Share Posted September 15, 2012 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. Quote Link to comment 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... Quote Link to comment Share on other sites More sharing options...
hakimserwa Posted September 15, 2012 Share Posted September 15, 2012 whats his problem Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted September 15, 2012 Share Posted September 15, 2012 whats his problem What is whose problem? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
ManiacDan Posted September 16, 2012 Share Posted September 16, 2012 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. Quote Link to comment 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.