[pmwiki-users] regex for full page names with anchor suffixes

Patrick R. Michaud pmichaud at pobox.com
Mon Nov 12 12:42:06 CST 2007


On Fri, Nov 09, 2007 at 02:23:31PM +0000, Hans wrote:
> > If you really want a bare option syntax for pagenames, then
> > I suggest keeping the pattern very simple (and possibly permissive)).
> > I'll space it out here for clarity:
> >...[snip]..
> 
> Thanks! This is very helpful! I try to use this now like this, with
> the option of using => or = as divider:
> 
> $arg = ParseArgs($arg,
> '(?>([-\\w]+(?:\.[-\\w]+)?(?:\\w#[-.\\w]*)?(?:\\#[-.\\w]*)?)(?:=>?|:))');
> 
> ParseArgs works with it, but the > from the => gets put as first
> character to the value, and I have to run it through a "cleaner":
> 
>    if(substr($v,0,4)==">") $arg[$k] = substr($v,4);
> 
> Can this be avoided? Why is it added? Thanks for help with this!

Oh, sorry.  I forgot that any >'s in the markup would get converted
to > first.  Try this expression instead for the =>/=/: part...

    (?:=>|[=:])

Pm



More information about the pmwiki-users mailing list