[pmwiki-users] proposal for "name" and "group" wildcards

Patrick R. Michaud pmichaud at pobox.com
Wed Jan 11 16:38:29 CST 2006


In response to another thread, here's my proposal for supporting
wildcards in "name" and "group" parameters, used both in
conditional markup and in pagelists...

1.  Wildcarding follows the standard shell wildcard rules, where
    an asterisk '*' represents zero or more characters and a 
    question mark '?' means any single character.  

2.  Specifying a group or name parameter without a dot in it 
    matches only the group or name portion of a pagename.  

3.  Specifying a group or name parameter with a dot implies a 
    match on the full pagename.

Thus, we have:

    name=XYZ           any page named XYZ in any group         (*.XYZ)
    group=XYZ          any page in the XYZ group               (XYZ.*)
    name=*-XYZ         any page ending in "-XYZ"               (*.*-XYZ)
    group=PmWiki       any page in a group begining with PmWik (PmWiki*.*)

and the dotted form

    name=PmWiki.*Index   all pages in the PmWiki group ending with "Index"

These work in both pagelists...

    (:pagelist name=PmWiki.*Index:)

and in conditional markup

    (:if name PmWiki.*Index:)

4.  We'll also allow comma-separated lists of patterns, thus:

    (:if group 2004,2005,PmWiki.* :)

5.  Negations are also allowed:

    (:pagelist group=PmWiki*,-PmWikiFr :)
    (:pagelist group=PmWiki name=-PmWiki:)

6.  Even though my examples above might not show it, it is fully
    possible to have multiple wildcards in a single specification.

Comments?

Pm




More information about the pmwiki-users mailing list