Index: trunk/extensions/RegexFun/RELEASE-NOTES |
— | — | @@ -0,0 +1,35 @@ |
| 2 | + Changelog: |
| 3 | + ========== |
| 4 | + * November 4, 2011 -- Version 1.0 (initial public release). |
| 5 | + Introduces the following parser functions defined within 'ExtRegexFun' class: |
| 6 | + - #regex |
| 7 | + - #regexall |
| 8 | + - #regex_var |
| 9 | + - #regexquote |
| 10 | + |
| 11 | + Main features: |
| 12 | + - Searching within strings, using regular expression. |
| 13 | + - Replacing within strings, using regular expression. |
| 14 | + - Allows save use of user input within expressions by running '#regexquote' parser function |
| 15 | + over it. An important function other regex extensions still lack. |
| 16 | + - Allows to get the last '#regex' subexpression matches via '#regex_var', even allows to |
| 17 | + get them in an extensive way, e.g. "$0 has $2, $1 and $3". |
| 18 | + - Invalid regex will result in an inline error message instead of php notice as some other |
| 19 | + regex extensions might do it. |
| 20 | + - Efficient regex validation allowing all kinds of delimitiers and flags but filtering 'e' |
| 21 | + flag for security reasons in any case... |
| 22 | + - ... therefore, original 'e' flag instead has another but very similar meaning adjusted for |
| 23 | + a mediawiki context. Instead of executing php code within the replacement string, the 'e' |
| 24 | + flag now causes the replacement string to be parsed after references ('$1', '\1') are |
| 25 | + replaced. This allows stuff like "{{((}}Template{{!}}$1{{))}}" within the replacement. |
| 26 | + |
| 27 | + Changes since earlier versions (trunk and earlier, non-public): |
| 28 | + - '#regexsearch' parser function removed. Instead there is a special flag 'r' now which leads |
| 29 | + to the same result if #regex and replacement is being used: '' as output if nothing replaced. |
| 30 | + - '#regexascii' parser function removed. Instead '#regexquote' will make an ascii-quote MW |
| 31 | + special characters ';' and '#' if they are first character in the string. |
| 32 | + - '#regexquote' delimiter set to '/' by default. |
| 33 | + - '#regex' no longer returns its value as parsed wikitext (option 'noparse' => false) instead |
| 34 | + the 'e' flag can be used (although not exactly the same). |
| 35 | + - contributed under ISC License, maintained in wikimedia.org svn.======= |
| 36 | + |
\ No newline at end of file |
Property changes on: trunk/extensions/RegexFun/RELEASE-NOTES |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 37 | + native |
Index: trunk/extensions/RegexFun/COPYING |
— | — | @@ -0,0 +1,13 @@ |
| 2 | +Copyright (c) 2010 - 2011 by Daniel Werner < danweetz@web.de > |
| 3 | + |
| 4 | +Permission to use, copy, modify, and/or distribute this software for any |
| 5 | +purpose with or without fee is hereby granted, provided that the above |
| 6 | +copyright notice and this permission notice appear in all copies. |
| 7 | + |
| 8 | +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 9 | +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 10 | +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 11 | +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 12 | +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 13 | +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 14 | +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
\ No newline at end of file |
Property changes on: trunk/extensions/RegexFun/COPYING |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 15 | + native |
Index: trunk/extensions/RegexFun/README |
— | — | @@ -0,0 +1,40 @@ |
| 2 | +== About == |
| 3 | + |
| 4 | +''Regex Fun'' is a MediaWiki extension by Daniel Werner which adds parser functions for performing regular expression |
| 5 | +searches and replacements. |
| 6 | +The '#regex' parser function is inspired by 'RegexParserFunctions' extension from Jim R. Wilson and mostly compatible |
| 7 | +with it. 'RegexParserFunctions' simply is outdated and lacks some advanced functionality provided by this extension. |
| 8 | + |
| 9 | +''Regex Fun'' defines the following parser functions within your wiki: |
| 10 | + |
| 11 | + - #regex: Search or replace with help of php preg regular expression. Returns first match in search mode. |
| 12 | + Use of the 'e' modifier behind the expression will be detected, the effect of using 'e' now is |
| 13 | + adapted for mediawiki. With 'e' the replacement string will be parsed after references are replaced. |
| 14 | + - #regexall: Searches the whole string for as many matches as possible and returns them separated by a separator. |
| 15 | + - #regex_var: Allows to access references of the last used 'regex' or 'regexsearch' function. |
| 16 | + - #regexquote: Runs php function 'preg_quote' on a string to use user-input savelly in regex functions. In case the |
| 17 | + first character is a character with special meaning in MW, it will be replaced with its hexadecimal |
| 18 | + notation e.g. '\x23' instead of '#'. This will prevent from things going terribly wrong when using |
| 19 | + user input within a regular expression. |
| 20 | + |
| 21 | +* Website: http://www.mediawiki.org/wiki/Extension:Regex_Fun |
| 22 | +* License: ISC license |
| 23 | +* Author: Daniel Werner < danweetz@web.de > |
| 24 | + |
| 25 | + |
| 26 | +== Installation == |
| 27 | + |
| 28 | +Once you have downloaded the code, place the 'RegexFun' directory within your |
| 29 | +MediaWiki 'extensions' directory. Then add the following code to your |
| 30 | +[[Manual:LocalSettings.php|LocalSettings.php]] file: |
| 31 | + |
| 32 | + # Regex Fun |
| 33 | + require_once( "$IP/extensions/RegexFun/RegexFun.php" ); |
| 34 | + |
| 35 | + |
| 36 | +== Contributing == |
| 37 | + |
| 38 | +If you have bug reports or requests, please add them to the ''Regex Fun'' Talk page [0]. |
| 39 | +You can also send them to Daniel Werner < danweetz@web.de > |
| 40 | + |
| 41 | +[0] http://www.mediawiki.org/w/index.php?title=Extension_talk:Regex_Fun |
\ No newline at end of file |
Property changes on: trunk/extensions/RegexFun/README |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 42 | + native |