This plugin allows to substitute and extract information from content by
using regular expressions. There are three different types of new functions:
FORMATLIST: maniplulate a list of items; it is highly configurable to define what constitutes a list and how to extract items from it
SUBST, STARTSUBST/STOPSUBST: substiture a pattern in a chunk of text
EXTRACT, STARTEXTRACT/STOPEXTRACT: extract a pattern from a text
While the START-STOP versions of SUBST and EXTRACT work on inline text,
the normal versions process a source topic before including it into the current one.
Syntax Rules
SUBST
Syntax: %SUBST{topic="..." ...}%
insert a topic by processing its content.
topic="...": name of the topic text to be processed
pattern="...": pattern to be extracted or substituted
format="...": format expression or pattern substitute
header="...": header string prepended to output
footer="...": footer string appended to output
limit="<n>" maximum number of occurences to extract or substitute counted from the start of the text (defaults to 100000 aka all hits)
skip="<n>" skip the first n occurences
exclude="...": skip occurences that match this regular expression
sort="on,off,alpha,num" order of the formatted items (default "off")
expand="on,off": toggle expansion of TWiki markup before filtering (defaults to on)
Syntax: %FORMATLIST{"<list>" ...}%
formats a list of items. The <list> argument is separated into items by using
a split expression; each item is matched agains a pattern and then formatted
using a format string while being separated by a separator string; the result is
prepended with a header and appended with a footer in case the list is not empty.
<list>: the list
split="...": the split expression (default ",")
pattern="...": pattern applied to each item (default "\s(.*)\s")
format="...": the format string for each item (default "$1")
header="...": header string
footer="...": footer string
separator="...": string to be inserted between list items
limit="...": max number of items to be taken out of the list (default "-1")
skip="...": number of list items to skip, not adding them to the result
sort="on,off,alpha,num" order of the formatted items (default "off")
reverse="on,off": reverse the sortion of the list
unique="on,off": remove dupplicates from the list
exclude="...": remove list items that match this regular expression
The pattern string shall group matching substrings in the list item to which you can refer to by
using $1, $2, ... in the format string. Any format string (format, header, footer) may
contain variables $percnt$, $nop, $dollar and $n. The variable
$index referse to the position number within the list being formatted; using $count in the
footer or header argument refers to the total number of list elements.
MAKEINDEX
Syntax: %MAKEINDEX{"<list>" ...}%
formats a list into a multi-column index like in MediaWiki's category topcis.
MAKEINDEX insert capitals as headlines to groups of sorted items. It will try to balance all
columns equally, and keep track of breaks to prevent "schusterkinder", that is avoid
isolated headlines at the bottom of a column.
parameters:
<list>: the list of items
split="...": the split expression to separate the <list> into items (default ",")
pattern="...": pattern applied to each item (default "(.*)")
cols="...": maximum number of cols to split the list into
format="...": format of each list item (default "$item")
exclude="...": pattern to check against items in the list to be excluded
reverse="on/off": reverse the list (default "off")
header="...": format string to prepend to the result
footer="..." format string to be appended to the result
Like in FORMATLIST the format parameter can make use of $1, $2, ... variables
to match the groupings defined in the pattern argument (like in pattern="(.*);(.*);(.*)") .
The first matched grouping $1 will be used as the $item to sort the list.
Examples
Secure Html
<a href="javascript:window.alert('Pop me up');">Pop me up</a>