[pmwiki-users] markup expression for explode-like effect

Patrick R. Michaud pmichaud at pobox.com
Wed Apr 25 09:08:16 CDT 2007


On Wed, Apr 25, 2007 at 03:48:45PM +0200, noskule wrote:
> hi list
> I seen the markup expressions but could not find something like explode 
> to separate something like -XXX:
> 
> PageName-Discussion -> PageName

If you know that you want to strip off "-Discussion", you can do:

    $BaseNamePatterns['/-Discussion$/'] = '';

Then {$BaseName} for PageName-Discussion will result in "PageName".

Or, if you just want $BaseName to strip everything after a 
hyphen, it's

    $BaseNamePatterns['/-.*$/'] = '';

Pm



More information about the pmwiki-users mailing list