[pmwiki-devel] Quick preg_replace question...

Patrick R. Michaud pmichaud at pobox.com
Fri Apr 27 10:59:24 CDT 2007


On Fri, Apr 27, 2007 at 11:56:12AM -0400, The Editor wrote:
> I'm out of time to test this now but will look into it...  Maybe:
> 
> '/([\n]{0,1})\[([trc]{1})(.*?)\]/e'

Just a note that [\n]{0,1} is written shorter (and faster) as \n? .

   '/(\n?)\[([trc])(.*?)\]/e'

It's probably also a good idea to put a \b after [trc], so that
the markup engine won't inadvertently think that [citation]
is to be treated the same as [c].

   '/(\n?)\[([trc]\\b)(.*?)\]/e'

Pm



More information about the pmwiki-devel mailing list