[Pmwiki-users] New pages using numeric characters

Patrick R. Michaud pmichaud
Fri Jan 9 08:24:16 CST 2004


On Thu, Jan 08, 2004 at 10:01:01PM -0600, Dawn Green wrote:
> When trying to create a link and new page using a combination of letters and
> numbers, I typed the following:
>     [[Suite103 Suite 103]]
> [...]  I was told that in order to force the new page using the
> letter/number combination, I should try:
>    [[{{Suite103}} Suite 103]]
> This worked.  Is there a way to override this more complicated way of
> creating new pages with numbers for a more uniform page creation method?  

Of course there is, but with a couple of caveats.  The reason that
{{Suite103}} works and Suite103 doesn't is that it's a valid FreeLink but
not a valid WikiWord.  

PmWiki's default WikiWord pattern says that a WikiWord must begin with an 
uppercase letter and have at least one more uppercase letter and lowercase 
letter (in any order).  Digits are treated as lowercase letters for this
purpose, so "Suite103" doesn't look like a WikiWord to PmWiki and has to
be created as a FreeLink.

However, you can change the $WikiWordPattern to specify whatever rules you
like.  So, if you want to accept that any word with a capital letter and
at least one digit is a valid WikiWord, you can change the pattern to:

$WikiWordPattern="[A-Z][A-Za-z0-9]*(?:[0-9]|[A-Z][a-z]|[a-z][A-Z])[A-Za-z0-9]*";

The caveat: Keep in mind that changing patterns in this manner can cause
words and things that aren't intended to be links to suddenly look like 
WikiWords to PmWiki.  To borrow from another example, links to pages in
other groups can be specified using either Group.WikiWord or Group.{{Word}},
and some people have asked that plain Group.Word (without the braces)
be enabled as well.  The problem with doing this is that many abbreviations 
that occur in normal text (such as Ph.D) then act like links to other
pages.

I'm always glad to help others create specialized patterns to fit their
particular needs--PmWiki's pattern set is designed to hit a wide generic
audience but allow administrators the flexibility to customize things to
their specific needs.

> I noticed that the PmWiki Doc index makes no mention of numeric characters 
> for new pages.

Feel free to change the docs to be more helpful...  :-)

Pm



More information about the pmwiki-users mailing list