Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeroendedauw/regexfun
Regex"Fun". Fork of https://www.mediawiki.org/wiki/Extension:RegexFun. Not supported.
https://github.com/jeroendedauw/regexfun
Last synced: 8 days ago
JSON representation
Regex"Fun". Fork of https://www.mediawiki.org/wiki/Extension:RegexFun. Not supported.
- Host: GitHub
- URL: https://github.com/jeroendedauw/regexfun
- Owner: JeroenDeDauw
- License: isc
- Created: 2022-11-08T21:21:19.000Z (about 2 years ago)
- Default Branch: prowiki-fixes
- Last Pushed: 2022-11-09T13:51:30.000Z (about 2 years ago)
- Last Synced: 2024-10-16T14:41:13.234Z (about 1 month ago)
- Language: PHP
- Homepage:
- Size: 235 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: COPYING
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
== About ==
''Regex Fun'' is a MediaWiki extension by Daniel Werner which adds parser functions for performing regular expression
searches and replacements.
The '#regex' parser function is inspired by 'RegexParserFunctions' extension from Jim R. Wilson and mostly compatible
with it. 'RegexParserFunctions' simply is outdated and lacks some advanced functionality provided by this extension.''Regex Fun'' defines the following parser functions within your wiki:
- #regex: Search or replace with help of php preg regular expression. Returns first match in search mode.
Use of the 'e' modifier behind the expression will be detected, the effect of using 'e' now is
adapted for mediawiki. With 'e' the replacement string will be parsed after references are replaced.
- #regexall: Searches the whole string for as many matches as possible and returns them separated by a separator.
- #regex_var: Allows to access subexpression references of the last used 'regex' function.
- #regexquote: Runs php function 'preg_quote' on a string to use user-input savelly in regex functions. In case the
first character is a character with special meaning in MW, it will be replaced with its hexadecimal
notation e.g. '\x23' instead of '#'. This will prevent from things going terribly wrong when using
user input within a regular expression.* Website: https://www.mediawiki.org/wiki/Extension:Regex_Fun
* License: ISC license
* Author: Daniel Werner < [email protected] >== Installation ==
Once you have downloaded the code, place the 'RegexFun' directory within your
MediaWiki 'extensions' directory. Then add the following code to your
[[Manual:LocalSettings.php|LocalSettings.php]] file:# Regex Fun
require_once( "$IP/extensions/RegexFun/RegexFun.php" );