[dokuwiki] Re: Search pattern challenge for plugin
- From: Chris Smith <chris@xxxxxxxxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Wed, 27 Dec 2006 14:01:02 +0000
Martin Tschofen wrote:
So obvious, that does the trick. Thanks a lot for pointing this out.
Got another one if the pattern is preceeded by a [[reveal wide
10%|[[link]]/] DW thinks it's a link and gobbles it all up. I tried a
negative lookbehind: (?>!\[) before the pattern, but DW still thinks
it's a
link. Tried various sorts without success.
Thanks...martin
Two problems.
- sorts don't stop another pattern matching. DW prioritises the pattern
that matches earlier in the string. The link syntax will match on the
first [, one character earlier than your pattern. When two patterns can
match at the same character, DW will favour the pattern with the lower
sort order.
- negative look behind at the start of a pattern is not guaranteed to
work. DW parses the wiki text incrementally, each subsequent match
attempt starts at the next character after the last successful match.
Why is it important to use square brackets? Wouldn't it make things
easier to use curly brackets or angle brackets?
Are you attempting a slight variation on the folded plugin? Can you use
its syntax?
Cheers,
Chris
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist
- Follow-Ups:
- [dokuwiki] Re: Search pattern challenge for plugin
- From: Martin Tschofen
- References:
- [dokuwiki] Search pattern challenge for plugin
- From: Martin Tschofen
- [dokuwiki] Re: Search pattern challenge for plugin
- From: Chris Smith
- [dokuwiki] Re: Search pattern challenge for plugin
- From: Martin Tschofen
Other related posts:
- » [dokuwiki] Search pattern challenge for plugin
- » [dokuwiki] Re: Search pattern challenge for plugin
- » [dokuwiki] Re: Search pattern challenge for plugin
- » [dokuwiki] Re: Search pattern challenge for plugin
- » [dokuwiki] Re: Search pattern challenge for plugin
So obvious, that does the trick. Thanks a lot for pointing this out. Got another one if the pattern is preceeded by a [[reveal wide 10%|[[link]]/] DW thinks it's a link and gobbles it all up. I tried anegative lookbehind: (?>!\[) before the pattern, but DW still thinks it's a
link. Tried various sorts without success. Thanks...martin
- [dokuwiki] Re: Search pattern challenge for plugin
- From: Martin Tschofen
- [dokuwiki] Search pattern challenge for plugin
- From: Martin Tschofen
- [dokuwiki] Re: Search pattern challenge for plugin
- From: Chris Smith
- [dokuwiki] Re: Search pattern challenge for plugin
- From: Martin Tschofen