[Pmwiki-users] (Beta13+) Want to swap {{ }} for [[ ]])

Steven Leite steven_leite
Sun Feb 15 19:42:55 CST 2004


>    $GroupNamePattern="[[:upper:]][[:alnum:]]+";

Not that anyone want to do this, but suppose you wanted to allow for a
$GroupNamePattern to consist of any upper or lower case letter, follow more
ZERO or more character (Thus allowing for page Titles to be of one character
in length).  How could you change the following expression to do that?

>    $GroupFreeLinkPattern="{{(?>(?:($GroupNamePattern)([.\\/]))?([[:alpha:
>    ]][[:alnum:]]*(?:(?:[\\s_]*|-)[[:alnum:]]+)*)(?:\\|((?:(?:[\\s_]*|-)[[
>    :alnum:]])*))?)}}((?:-?[[:alnum:]]+)*)";

> This one is too complex to explain this early in the morning.  Sorry.  :-)

It's evening time now.  Heh.


>    $FragmentPattern="#([A-Za-z][-.:\\w]*)";

Can you briefly explain what the purpose of the $FragmentPattern is and when
it's used?

>    $PageTitlePattern="[[:upper:]][[:alnum:]]*(?:-[[:alnum:]]+)*";
>
> A page's title (name) consists of an uppercase character ([[:upper:]]),
> followed by zero or more alphanumeric characters ([[:alnum:]]*).
> Hyphens can exist in page names, but each hyphen must be immediately
> followed by at least one alphanumeric character.

How would you modify the $Pattern (above) to remove the restriction on
hyphens?
For example, allowing a page title:
My - - New -- Page - - -"

If all this (useful) talk about creating/modifying and understanding
regexpression were to be in the documentation somewhere, what is a good
category/page title for it?  I think I'll collect all the little bits of
infor and eventually make a page for it.   Many users are bound to ask the
same questions eventually.

--S




More information about the pmwiki-users mailing list