Loading...
 
Skip to main content

History: PluginRegex

Source of version: 10 (current)

Copy to clipboard
            ! Plugin Regex
Use this ((wiki plugin)) to use a "regular expression" style search expression from another wiki page to search for and replace text in the body of the plugin (between the -+REGEX+- tags).

!! Parameters
{pluginmanager plugin="regex"}
To use this plugin:
# Place the search pattern (enclosed with forward slashes) and replacement text on a separate wiki page, separated by two colons ( -+::+- ). For example:
+ -+/search pattern/::replacement text+-
# Then enter that page name as the -+pageName+- parameter value of the plugin. 
# The text in the body of the plugin (between the -+REGEX+- tags) will be searched and each match of the search pattern will be replaced by the replacement text. 

This plugin mimics the [http://www.php.net/preg_replace|preg_replace] PHP function. For advanced search patterns, see [http://www.php.net/manual/en/reference.pcre.pattern.syntax.php] in the online PHP manual or simply search the internet for "regular expression syntax".
!! Example
''This code:''
{CODE(colors="tiki")}
{REGEX(pageName="PluginRegex Example")}I had a horrible day.{REGEX}
{CODE}

''Plus this syntax on a separate wiki page called ((PluginRegex Example))'':

 -+/horrible/::wonderful+-

''Would produce:''

{REGEX(pageName=PluginRegex Example)}I had a horrible day.{REGEX}
!! Aliases
(alias(Plugin Regex)) | (alias(PluginRegularExpression)) | (alias(Plugin RegularExpression)) | (alias(Plugin Regular Expression))