[pmwiki-devel] php regex question

Hans design5 at softflow.co.uk
Wed Dec 5 11:11:19 CST 2007


Is it possible to use  preg_replace("/$string/", $rep, $text)
and preg_match_all, where $string is a text string which could contain
preg control characters like ()[] and slashes etc, but these should
not be interpreted as control characters, only as plain characters,
but I cannot escape them easily, because I don't know if and where any
may be?

I am grateful for any hints.

The alternative would be to use string functions only, and I would
need to write a function which could pull all occurrences of $string in
$text with their positions. Or perhaps there is such a function?

 Hans




More information about the pmwiki-devel mailing list