[pmwiki-users] Re: Modified (:markup:)

Patrick R. Michaud pmichaud at pobox.com
Mon Mar 21 09:14:54 CST 2005


On Mon, Mar 21, 2005 at 08:44:40AM +0100, Joachim Durchholz wrote:
> Patrick R. Michaud wrote:
> >I agree, but my implementation of [== ... ==]  currently breaks in 
> >the face of text containing multiple [==]'s, so I have to either come
> >up with a much better pattern or go back to the drawing board.
> 
> Would a backreference work?
> 
>   \[(=*)[^=](.*?)\1\]

The matching code already uses a backreference and no it doesn't work.

> The (=*) captures the string of =s after the opening [ and stores them 
> in the $1 variable, the [^= makes sure that a non-= is between the 
> brackest-and-equals-signs delimiters (else we'd match stuff like [==] 
> and we don't want that - might be a useful markup for other purposes), 

Unfortunately, [==] is already valid markup and it's already being
used for a variety of purposes.  In particular, it can be used to
prevent Wiki[==]Words, and I've used it to avoid processing something
that would otherwise be a beginning of line markup.  Thus:

   [==]** Line beginning with ''asterisks'', avoid Wiki[==]Word.

Unfortunately, the regexp above (and various others I've tried)
sees this as one big escape instead of two small ones, resulting in

   ]** Line beginning with ''asterisks'', avoid Wiki[Word.

Pm



More information about the pmwiki-users mailing list