[Mediawiki-l] escaping "*" character in regexp

Rowan Collins rowan.collins at gmail.com
Mon Jan 24 17:24:56 UTC 2005


On Sun, 23 Jan 2005 01:37:34 -0600, =James Birkholz=
<j.birchwood at verizon.net> wrote:
> how do I get the "*" to be treated as a literal character, instead of "any
> number of occurances" designator?

>          $output =  ereg_replace("Z//*","&#379;", $output);

You're using the wrong slash: "escaping" of this sort is done with a
backslash, so "Z\\*" (or, more readably, I think you can use single
quotes to avoid the need for escaping twice: 'Z\*')

-- 
Rowan Collins BSc
[IMSoP]



More information about the MediaWiki-l mailing list