[pmwiki-users] Re: Modified (:markup:)
Jonathan Scott Duff
duff at pobox.com
Mon Mar 21 13:18:54 CST 2005
On Mon, Mar 21, 2005 at 12:36:34PM -0600, Patrick R. Michaud wrote:
> On Mon, Mar 21, 2005 at 06:23:38PM +0100, Joachim Durchholz wrote:
> > So I'll punt and simply use an alternative:
> >
> > \[ (=+) ( \] | (.*?) \1 \] )
> > 1111111 22 33333333333 (these line just
> > aaaaa bb cc for reference below)
>
> I thought of this previously, the bad part being that it's then
> impossible to escape anything that begins with a closing bracket,
> which just seems wrong. I.e., in the current implementation I can do
>
> [=]]=]
>
> but this wouldn't work if we disallow bracket as an initial character.
> Yes, I can come up with cases where someone might want this -- e.g.,
> if they need to place an escaped closing bracket inside of link text.
Okay, how about this one:
/\[(?:==)+\]|\[(=+)(.*?)\1\]/se
or, equivalently:
/\[(?:(?:==)+|(=+)(.*?)\1)\]/se
Though they are the same number of characters, I tend to like the
first version more because there are fewer parenthesized things.
Note that we're back to requiring an even number of = for the empty
group.
-Scott
--
Jonathan Scott Duff
duff at pobox.com
More information about the pmwiki-users
mailing list