Forum Moderators: open
However, mine is aimed at *much* smaller user bases than yours - private fora where there are few enough users that every single one personally knows every single other one, and outsiders aren't allowed in. That may let me do things that are prohibitively expensive when you're running a board as big as this one.
$string="The post text";
while (preg_match("/(.*)[ quote](.*)[\/quote](.*)/",$string,$found)) $string=$found[0]."<the html code for open quote>".$found[1]."<the html code for closing quote>".$found[2];
ie - when it finds A PAIR of quote tags it replaces them with the html formatting needed... but i suspect a large regex would be heavy work for your forum brett?
Ok, not millions per day, but my CPU usage barely breaches 99% most of that 1% is other system stuff...
your average OLD cpu does what, 2000 million operations/sec, let each regex take 10000 operations, divide 14 million by 200000, so you have to spend 70 CPU seconds per day, no sweat. play the numbers, replace the regex with an optimized matching function in C, and you should be game.
Custom parsers, if well written, can rival simple replace operations.
But I didn't say it wouldn't be a load of work ;)))
SN
[edited by: eelixduppy at 8:06 pm (utc) on Feb. 18, 2009]