Difference between revisions of "ReNamer:Rules:Replace"

From den4b Wiki
Jump to navigation Jump to search
Line 1: Line 1:
{{Template:Cleanup}}
+
{{Template:Cleanup}}  
  
== Replace Rule ==
+
== Replace Rule ==
<center>[[Image:ReplaceRule.png]]</center>
+
<center>[[Image:ReplaceRule.png]]</center>  
 +
This rule removes the specified string from the name and replaces it with another string. It has options to replace the first occurrence only, the last occurrence only, or all the occurrences. You can replace multiple strings at a time. The rule will replace ''each'' of them with the same replacement string. You can create a pattern with wild cards, so that any string that matches the pattern will be removed.
  
This rule removes the specified string from the name and replaces it with another string. It has options to replace the first occurrence only, the last occurrence only, or all the occurrences. You can replace multiple strings at a time. The rule will replace ''each'' of them with the same replacement string. You can create a pattern with wild cards, so that any string that matches the pattern will be removed.
+
The parameters are as follows:  
 
 
The parameters are as follows:
 
  
 
{| class="prettytable"
 
{| class="prettytable"
! Parameter
+
|-
 +
! Parameter  
 
! Details
 
! Details
 
 
|-
 
|-
| Find
+
| Find  
| Enter the string to be replaced.
+
| Enter the string to be replaced.  
 
+
*You can enter multiple strings at a time. Press the + button to separate two strings  
* You can enter multiple strings at a time. Press the + button to separate two strings
+
*If the name does not contain the specified string, the rule will not act on it.  
* If the name does not contain the specified string, the rule will not act on it.
+
*If the name contains more than one of these strings, it will replace all of them.
* If the name contains more than one of these strings, it will replace all of them.  
 
  
 
|-
 
|-
| [[Image:PlusButton.png]] button
+
| [[Image:PlusButton.png]] button  
| Press to insert a <nowiki>*|*</nowiki> separator between strings.
+
| Press to insert a <nowiki>*|*</nowiki> separator between strings.  
This inserts a separator in Replace box also. This means that pairs are replaced (e.g. A -->A', B -->B' etc.)
+
This inserts a separator in Replace box also. This means that pairs are replaced (e.g. A --&gt;A', B --&gt;B' etc.) }  
}
 
  
 
|-
 
|-
| Replace
+
| Replace  
| Enter the string that will replace the "Find" string.
+
| Enter the string that will replace the "Find" string.  
 
+
*Note that although the rule can find different strings, it can use only one string as replacement. If you do not want that, you will have to add the '''Replace''' rule multiple times, with specific pairs of ''find ''and ''replace'' strings.
* Note that although the rule can find different strings, it can use only one string as replacement. If you do not want that, you will have to add the '''Replace''' rule multiple times, with specific pairs of ''find ''and ''replace'' strings.
 
  
 
|-
 
|-
| Insert meta tag
+
| Insert meta tag  
[[Image:ReNamer Insert Meta Tag Button.png]]
+
[[Image:ReNamer Insert Meta Tag Button.png]]  
| Click the button to see a list of meta-tags.
 
  
 +
| Click the button to see a list of [[ReNamer:Meta_Tags|meta-tags]].
 
|-
 
|-
| Occurrences
+
| Occurrences  
 
| In case the strings occurs multiple times in the name, specify which occurrences should be replaced. (Options are- ''First only'', ''last only'', or ''all'')
 
| In case the strings occurs multiple times in the name, specify which occurrences should be replaced. (Options are- ''First only'', ''last only'', or ''all'')
 
 
|-
 
|-
| Skip extension
+
| Skip extension  
 
| If this check box is unselected, the extension will be included in the rule.
 
| If this check box is unselected, the extension will be included in the rule.
 
 
|-
 
|-
| Case sensitive
+
| Case sensitive  
 
| Will only remove a specified string from the name if the case matches exactly.
 
| Will only remove a specified string from the name if the case matches exactly.
 
 
|-
 
|-
| Interpret symbols as wild cards
+
| Interpret symbols as wild cards  
| The following wild cards are allowed (compare with RegEx).
+
| The following wild cards are allowed (compare with RegEx).  
 
 
 
{| class="prettytable"
 
{| class="prettytable"
!
+
|-
! Represents
+
!  
 +
! Represents  
 
! Example
 
! Example
 
 
|-
 
|-
| <center><nowiki>*</nowiki></center>
+
| <center>*</center>  
| any number of characters (including numbers, space, underscores, etc.).
+
| any number of characters (including numbers, space, underscores, etc.).  
 
| '''abc*''' equals '''abc''' followed by 0 or more characters.
 
| '''abc*''' equals '''abc''' followed by 0 or more characters.
 
 
|-
 
|-
| <center>?</center>
+
| <center>?</center>  
| Any single character (including numbers, space, underscores, etc.)
+
| Any single character (including numbers, space, underscores, etc.)  
 
| '''ab?d''' equals '''abcd''', '''ab1d''', '''ab d''', '''ab_d''', etc.
 
| '''ab?d''' equals '''abcd''', '''ab1d''', '''ab d''', '''ab_d''', etc.
 
 
|-
 
|-
| <center><nowiki>[]</nowiki></center>
+
| <center>[]</center>  
| Brackets enclose a set of characters, any one of which may match a single character at that position.
+
| Brackets enclose a set of characters, any one of which may match a single character at that position.  
| '''<nowiki>foo[ab]ar </nowiki>'''equals '''fooaar''' and '''foobar'''
+
| '''foo[ab]ar '''equals '''fooaar''' and '''foobar'''
 
 
 
|-
 
|-
| <center>-</center>
+
| <center>-</center>  
| (only within a pair of brackets) denotes a range of characters.
+
| (only within a pair of brackets) denotes a range of characters.  
| '''<nowiki>foo[a-z]ar </nowiki>'''equals '''fooaar''', '''foobar,''' '''foocar,''' '''foodar,''' etc.
+
| '''foo[a-z]ar '''equals '''fooaar''', '''foobar,''' '''foocar,''' '''foodar,''' etc.
 
|}
 
|}
 +
 
|}
 
|}

Revision as of 10:31, 26 July 2009

{{{iparam}}} This article needs to be cleaned up!

Replace Rule

ReplaceRule.png

This rule removes the specified string from the name and replaces it with another string. It has options to replace the first occurrence only, the last occurrence only, or all the occurrences. You can replace multiple strings at a time. The rule will replace each of them with the same replacement string. You can create a pattern with wild cards, so that any string that matches the pattern will be removed.

The parameters are as follows:

Parameter Details
Find Enter the string to be replaced.
  • You can enter multiple strings at a time. Press the + button to separate two strings
  • If the name does not contain the specified string, the rule will not act on it.
  • If the name contains more than one of these strings, it will replace all of them.
PlusButton.png button Press to insert a *|* separator between strings.

This inserts a separator in Replace box also. This means that pairs are replaced (e.g. A -->A', B -->B' etc.) }

Replace Enter the string that will replace the "Find" string.
  • Note that although the rule can find different strings, it can use only one string as replacement. If you do not want that, you will have to add the Replace rule multiple times, with specific pairs of find and replace strings.
Insert meta tag

ReNamer Insert Meta Tag Button.png

Click the button to see a list of meta-tags.
Occurrences In case the strings occurs multiple times in the name, specify which occurrences should be replaced. (Options are- First only, last only, or all)
Skip extension If this check box is unselected, the extension will be included in the rule.
Case sensitive Will only remove a specified string from the name if the case matches exactly.
Interpret symbols as wild cards The following wild cards are allowed (compare with RegEx).
Represents Example
*
any number of characters (including numbers, space, underscores, etc.). abc* equals abc followed by 0 or more characters.
?
Any single character (including numbers, space, underscores, etc.) ab?d equals abcd, ab1d, ab d, ab_d, etc.
[]
Brackets enclose a set of characters, any one of which may match a single character at that position. foo[ab]ar equals fooaar and foobar
-
(only within a pair of brackets) denotes a range of characters. foo[a-z]ar equals fooaar, foobar, foocar, foodar, etc.