Difference between revisions of "Reference:Replace Text"
Fbaeckmann (talk | contribs) m (Text replacement - "|edition=BlueSpice free |active=Yes" to "|edition=BlueSpice free, BlueSpice pro, BlueSpice Farm, BlueSpice Cloud |active=Yes") |
Extension: Replace Text
Overview | |||
---|---|---|---|
Description: | Provides a form to let administrators do string replacements on the entire wiki, for both page contents and page titles. | ||
State: | stable | Dependency: | MediaWiki |
Developer: | Yaron Koren, Niklas Laxström | License: | - GPL v2+ |
Type: | MediaWiki | Category: | Administration |
Edition: | BlueSpice free, BlueSpice pro, BlueSpice Farm, BlueSpice Cloud | ||
For more info, visit Mediawiki.
|
Features[edit source]
The ReplaceText extension from MediaWiki provides features allows to change text passages in articles pages or article page titles . With a form, the throughout the entire wiki. The existing text and the wanted replacement text can be typed entered in a form. The extension searches for this these words or text passages and replaces it automatically. For this purpose, also filters them after a confirmation screen. Filters and configurations are available. In addition to this, also complex text changes can be done achieved by using placeholders and regular expressions.
The MediaWiki extension ReplaceText can be used with both MediaWiki and BlueSpice. The extension is available for download in our BlueSpice Marketplace.
To make this global changes, the extension provides a form at a special page. You can find it in the list of all special pages (Special:SpecialPages) in paragraph "Data and tools" or directly at Special:ReplaceText.
The "ReplaceText Form"[edit | edit source]Strictly speaking, there are two forms. In the first form you can:
- type in the already exiting, to be changed text
- type in the wanted, new text
- activate the checkbox for the usage of placeholders or regular expressions
- choose the namespaches, in which the changes should take place
- select additional filters for categories or page prefixes
- activate replacement for text or titles
If you made all your entries and configurations in this form, you will be led to the second form by clicking on the "Continue" button. All found articles and article titles, which contain the substitutional parts, will be listed there. Uncheck the boxes of the articles, which should not be changed. Moreover, there are two further options for configuration. Changes on the article title will be realized by Changes on the page title result in moving the original page - according to the wiki principle. Due to this, there There are some configurations for the moved page. Decide if:
- there should be a redirect from the moved page to the new one
- this page should be added to your watchlist
Confirm your choice with the "Replace" button to trigger the automatic replacement of the text passages. The last step is a confirmation from the system, which shows you what has been replaced and in how many articles this has been done.
Usage of regular expressions[edit | edit source]
To use regular expressions for replacing text, the corresponding box in the first form must be checked to activate the functionality. Only a subset of the regular expressions of PHP and MySQL can be used. The following characters can be used:
( ) . * + ? [ ] | as well as $1, $2 etc.
If the characters should be interpreted as real characters and not as part of a regular expression, a "\" must be added beforehand (like in the second example below: the dot is interpretet as a dot).
Examples:
Search String | Replace String | Behaviour |
a(.*)c | ac$1 |
Places all characters between a nad c at the end, e.g.:
azioc to aczio |
([0-9]*)\.([0-9]*) | $1,$2 |
Replaces the dot between the two numerical orders with a comma, e.g.:
2465.8924 zu 2465,8924 |
[edit | edit source]
If you want to move a text part, which is placed between two numerical orders, you would type in the following regular expression according to the example given above:Search String: 123(.*)456
Replace String: $1123456
to move the text from the middle to the beginning.
Due to the fact that a numerical order follows, the placeholder ($1) can not be used like meantioned above. In this case, the placeholder must be put in brackets to explicitly assign the numbering:Replace String: {$1}123456
Automatic replacements and version history[edit | edit source]
Also automatically done changes are edits or the article content and will be stored as new versions of the article. Those versions are marked as minor edits and have an entry in the version history of the article. Also further meta information is saved there in addition to the normal data like the time stamp, the editor, etc. Further information for replacements with ReplaceText:
- ruther designation of the user who initiated the replacement
- information about the process (e.g. "moved the page xy to yx without a redirect")
- the kind of text replacement
Useful links[edit | edit source]
For more information visit MediaWiki.
{{BSExtensionInfobox |desc=Provides a form to let administrators do string replacements on the entire wiki, for both page contents and page titles. |status=stable |developer=Yaron Koren, Niklas Laxström |type=MediaWiki |edition=BlueSpice free, BlueSpice pro |, BlueSpice Farm, BlueSpice Cloud |active=Yes |compatible=MediaWiki |category=Administration |license=GPL v2+ |docu=https://www.mediawiki.org/wiki/Extension:Replace_Text }} __NOTOC__The '''ReplaceText''' extension from MediaWiki provides features allows to change text passages in articlespages or articlepage titles. With a form, the throughout the entire wiki. The existing text and the wantedreplacement text can be typedentered in a form. The extension searches for thisthese words or text passages and replaces it automatically. For this purpose, also filters them after a confirmation screen. Filters and configurations are available. In addition to this, also complex text changes can be doneachieved by using placeholders and regular expressions. <div id="box-info" style="width: 98%; margin: 20px 0; border: solid 1px #ffae00; padding: 8px; background-color: #ffe4ab;"> [[Image:Icon-note.png|left]]<span style="text-transform: uppercase; color: #ffae00; font-size: 16px; font-weight: bold;"> Hint</span><div color:="" 000=""> The MediaWiki extension '''ReplaceText''' can be used with both MediaWiki and BlueSpice. The extension is available for download in our [http://shop.blue-spice.org BlueSpice Marketplace]. </div> </div> ==Where do I find ReplaceText?== To make this global changes, the extension provides a form at a special page. You can find it in the list of all special pages (''Special:SpecialPages'') in paragraph "Data and tools" or directly at ''Special:ReplaceText''. ==The "ReplaceText Form"== Strictly speaking, there are two forms. In the '''first form''' you can: * type in the already exiting, to be changed text * type in the wanted, new text * activate the checkbox for the usage of placeholders or regular expressions * choose the namespaches, in which the changes should take place * select additional filters for categories or page prefixes * activate replacement for text or titles If you made all your entries and configurations in this form, you will be led to the '''second form''' by clicking on the "Continue" button. All found articles and article titles, which contain the substitutional parts, will be listed there. Uncheck the boxes of the articles, which should not be changed. <br />Moreover, there are two further options for configuration. Changes on the article title will be realized by Changes on the page title result in moving the original page - according to the wiki principle. Due to this, there There are some configurations for the moved page. Decide if: * there should be a redirect from the moved page to the new one * this page should be added to your [[WatchList|watchlist]] Confirm your choice with the "Replace" button to trigger the automatic replacement of the text passages. The last step is a confirmation from the system, which shows you what has been replaced and in how many articles this has been done. ==Usage of regular expressions== To use regular expressions for replacing text, the corresponding box in the first form must be checked to activate the functionality. Only a subset of the regular expressions of PHP and MySQL can be used. The following characters can be used: <pre>( ) . * + ? [ ] | as well as $1, $2 etc.</pre> If the characters should be interpreted as real characters and not as part of a regular expression, a "\" must be added beforehand (like in the second example below: the dot is interpretet as a dot). '''Examples:''' {| class=" cuscosky" |- ||'''Search String''' ||'''Replace String''' ||'''Behaviour''' |- ||<tt>a(.*)c</tt> ||<tt>ac$1</tt> ||Places all characters between a nad c at the end, e.g.:<br />azioc to aczio |- ||<tt>([0-9]*)\.([0-9]*)</tt> ||<tt>$1,$2</tt> ||Replaces the dot between the two numerical orders with a comma, e.g.:<br />2465.8924 zu 2465,8924 |} === === If you want to move a text part, which is placed between two numerical orders, you would type in the following regular expression according to the example given above: <br /><br />'''Search String:''' 123(.*)456 '''Replace String: '''$1123456 to move the text from the middle to the beginning. Due to the fact that a numerical order follows, the placeholder ($1) can not be used like meantioned above. In this case, the placeholder must be put in brackets to explicitly assign the numbering:<br /><br />'''Replace String:''' {$1}123456 ==Automatic replacements and version history== Also automatically done changes are edits or the article content and will be stored as new versions of the article. Those versions are marked as minor edits and have an entry in the version history of the article. Also further meta information is saved there in addition to the normal data like the time stamp, the editor, etc. Further information for replacements with ReplaceText: * ruther designation of the user who initiated the replacement * information about the process (e.g. "moved the page xy to yx without a redirect") * the kind of text replacement ==Useful links== * [https://en.wikipedia.org/wiki/Regular_expression Article about "Regular expression" from Wikipedia] [[de:{{FULLPAGENAME}}]][[en:{{FULLPAGENAME}}]][[ For more information visit [[mediawikiwiki:Extension:Replace_Text|MediaWiki]]. {{Translation}} [[Category:BlueSpice free]] [[Category:MediaWiki]] [[Category:Extension]]
(26 intermediate revisions by 5 users not shown) | |||
Line 4: | Line 4: | ||
|developer=Yaron Koren, Niklas Laxström | |developer=Yaron Koren, Niklas Laxström | ||
|type=MediaWiki | |type=MediaWiki | ||
− | |edition=BlueSpice pro | + | |edition=BlueSpice free, BlueSpice pro, BlueSpice Farm, BlueSpice Cloud |
+ | |active=Yes | ||
|compatible=MediaWiki | |compatible=MediaWiki | ||
|category=Administration | |category=Administration | ||
+ | |license=GPL v2+ | ||
|docu=https://www.mediawiki.org/wiki/Extension:Replace_Text | |docu=https://www.mediawiki.org/wiki/Extension:Replace_Text | ||
}} | }} | ||
− | + | The '''ReplaceText''' extension from MediaWiki allows to change text passages in pages or page titles throughout the entire wiki. The existing text and the replacement text can be entered in a form. The extension searches for these words or text passages and replaces them after a confirmation screen. Filters and configurations are available. In addition to this, complex text changes can be achieved by using placeholders and regular expressions. | |
− | '''ReplaceText''' extension from MediaWiki | ||
− | + | Changes on the page title result in moving the original page - according to the wiki principle. There are some configurations for the moved page. | |
− | |||
− | |||
− | |||
− | |||
+ | For more information visit [[mediawikiwiki:Extension:Replace_Text|MediaWiki]]. | ||
− | + | {{Translation}} | |
− | |||
− | + | [[Category:BlueSpice free]] | |
− | + | [[Category:MediaWiki]] | |
− | + | [[Category:Extension]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | [ |