ive got something that almost works, i think youll like the solution i came up with
it works by checking the character directly before and after the phrase. If the characters are ones we specify that can be ignored, it will match it. the chracters to be ignored are in an array, so you can easily add/remove ignore chars if needed.
now it only checks 1 char before and 1 char after, but i think that will be sufficient in the majority of cases.
lemme get it working a bit better and ill post it
only thing is it needs php5 ... but that can be changed later
you know i never thought of just adding whitespace to all the possible problem punctuation. that could work. and its as easy as
Code: Select all
str_replace('.', ' . ', $document); // do this for each problem char
// do matching
str_replace(' . ', '.', $document); // return it to normal
nice idea
oh and mongol, the whole "too difficult dont wanna help" thing, it was just a joke, i hope it didnt sound bad. i have odd humor lol
you know, i know i have seen vbulletin boards with hacks that do EXACTLY this, but i dont recall if they matched phrases, i think it was just single words(which is easy as hell to do). But maybe they have improved it, ive seen some excellent coders working on vbulletin hacks.
if you want to look for it,
http://vbulletin.org
i think you can browse without a liscense, just cant view the whole code. If you find something, tell me, i have a liscense so i can grab it.
i saw it on a board that was running 2.x, and most everyones runs 3.x now, but id imagine they ported it to work on 3.x by now too, cause it was over a year ago when i saw it.