Extension:RegexParserFunctions

RegexParserFunctions adds a parser function called 'regex' (or 'regexp') which is used to perform regular expression pattern matching and replacement.

The extension in unmaintained by the original author, but is now maintained by me (User:VitaliyFilippov) as a part of Mediawiki4Intranet project. The security issue found by User:Pastakhov (one with the null-byte) is fixed in our version, and the extension is compatible with latest versions of MediaWiki.


 * Git repository: https://github.com/mediawiki4intranet/RegexParserFunctions
 * New homepage: http://wiki.4intra.net/RegexParserFunctions
 * Old homepage: http://jimbojw.com/wiki/index.php?title=RegexParserFunctions_Extension
 * Licensing: RegexParserFunctions is released under The MIT License.

Installation

 * 1) Clone the repository from https://github.com/mediawiki4intranet/RegexParserFunctions into $IP/extensions/ subdirectory
 * Note: $IP is your MediaWiki install dir.
 * 1) Enable the extension by adding this line to your LocalSettings.php:

Usage
Once installed, editors of your wiki can evaluate regular expressions in one of two ways: simple match, and replacement.


 * Simple match:, evaluates to the matching portion of &lt;string&gt;
 * Replacement:, evaluates to &lt;string&gt; with &lt;regex&gt; replaced by &lt;replacement&gt; globally

For example, say you're trying to grab the last portion of a Title which is using '/' delimiting subpage notation. For that, you could use:

Websites that use RegexParserFunctions

 * http://mtg.wikia.com
 * http://de.memory-alpha.org
 * http://potbs.wikia.com