https://www.mediawiki.org/wiki/Special:Code/MediaWiki/102062
Revision: 102062
Author: danwe
Date: 2011-11-04 22:36:08 +0000 (Fri, 04 Nov 2011)
Log Message:
-----------
Readme and release notes updated for 1.0, License added
Added Paths:
-----------
trunk/extensions/RegexFun/COPYING
trunk/extensions/RegexFun/README
trunk/extensions/RegexFun/RELEASE-NOTES
Added: trunk/extensions/RegexFun/COPYING
===================================================================
--- trunk/extensions/RegexFun/COPYING (rev 0)
+++ trunk/extensions/RegexFun/COPYING 2011-11-04 22:36:08 UTC (rev 102062)
@@ -0,0 +1,13 @@
+Copyright (c) 2010 - 2011 by Daniel Werner < [email protected] >
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+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
+ native
Added: trunk/extensions/RegexFun/README
===================================================================
--- trunk/extensions/RegexFun/README (rev 0)
+++ trunk/extensions/RegexFun/README 2011-11-04 22:36:08 UTC (rev 102062)
@@ -0,0 +1,40 @@
+== 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 references of the last used 'regex' or
'regexsearch' 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: http://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" );
+
+
+== Contributing ==
+
+If you have bug reports or requests, please add them to the ''Regex Fun'' Talk
page [0].
+You can also send them to Daniel Werner < [email protected] >
+
+[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
+ native
Added: trunk/extensions/RegexFun/RELEASE-NOTES
===================================================================
--- trunk/extensions/RegexFun/RELEASE-NOTES (rev 0)
+++ trunk/extensions/RegexFun/RELEASE-NOTES 2011-11-04 22:36:08 UTC (rev
102062)
@@ -0,0 +1,35 @@
+ Changelog:
+ ==========
+ * November 4, 2011 -- Version 1.0 (initial public release).
+ Introduces the following parser functions defined within 'ExtRegexFun'
class:
+ - #regex
+ - #regexall
+ - #regex_var
+ - #regexquote
+
+ Main features:
+ - Searching within strings, using regular expression.
+ - Replacing within strings, using regular expression.
+ - Allows save use of user input within expressions by running '#regexquote'
parser function
+ over it. An important function other regex extensions still lack.
+ - Allows to get the last '#regex' subexpression matches via '#regex_var',
even allows to
+ get them in an extensive way, e.g. "$0 has $2, $1 and $3".
+ - Invalid regex will result in an inline error message instead of php
notice as some other
+ regex extensions might do it.
+ - Efficient regex validation allowing all kinds of delimitiers and flags
but filtering 'e'
+ flag for security reasons in any case...
+ - ... therefore, original 'e' flag instead has another but very similar
meaning adjusted for
+ a mediawiki context. Instead of executing php code within the replacement
string, the 'e'
+ flag now causes the replacement string to be parsed after references
('$1', '\1') are
+ replaced. This allows stuff like "{{((}}Template{{!}}$1{{))}}" within the
replacement.
+
+ Changes since earlier versions (trunk and earlier, non-public):
+ - '#regexsearch' parser function removed. Instead there is a special flag
'r' now which leads
+ to the same result if #regex and replacement is being used: '' as output
if nothing replaced.
+ - '#regexascii' parser function removed. Instead '#regexquote' will make an
ascii-quote MW
+ special characters ';' and '#' if they are first character in the string.
+ - '#regexquote' delimiter set to '/' by default.
+ - '#regex' no longer returns its value as parsed wikitext (option 'noparse'
=> false) instead
+ the 'e' flag can be used (although not exactly the same).
+ - contributed under ISC License, maintained in wikimedia.org svn.=======
+
\ No newline at end of file
Property changes on: trunk/extensions/RegexFun/RELEASE-NOTES
___________________________________________________________________
Added: svn:eol-style
+ native
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs