You are here: Foswiki>Tasks Web>Item8491 (06 Jan 2015, GeorgeClark)Edit Attach

Item8491: regex manipulation of macro values

pencil
Priority: Enhancement
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: Macros
Branches:
Reported By: PatrickGosling
Waiting For:
Last Change By: GeorgeClark
"Wouldn't it be nice if" it were possible to refer to the value of a macro within a page, but perform some regex substitution on that value.

For instance, if I have a set of topics whose names have some structure, I might wish to refer to part of the topic name within the text of the topic.

Something along the lines of %REGEX{var="TOPIC" subst="s/^Prefix//"}% would be lovely (if you see what I mean).

As far as I can tell, the only practical way of achieving this at the moment is via the %CALC% macro, which is rather a heavyweight and displeasing-to-look-at solution.

If there is a cleaner solution to this, I'm going to be very embarrassed cool

If there isn't, I'll look into implementing it.

-- PatrickGosling - 10 Feb 2010

Try FilterPlugin

-- MichaelDaum - 10 Feb 2010
 

ItemTemplate edit

Summary regex manipulation of macro values
ReportedBy PatrickGosling
Codebase 1.0.9
SVN Range
AppliesTo Engine
Component Macros
Priority Enhancement
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic revision: r3 - 06 Jan 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy