Difference between revisions of "ReNamer:Rules:RegEx"

From den4b Wiki
Jump to navigation Jump to search
(Created page with '== RegEx Rule == [[Image:]]This rule finds matches for the specified RegEx pattern, and replaces them with another string. (RegEx is short for “Regular Expressions”. ...')
 
(Rephrased the introduction and updated reference links.)
 
(19 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== RegEx Rule ==
+
{{Go|up=ReNamer:Rules|prev=ReNamer:Rules:Translit|next=ReNamer:Rules:PascalScript}}
[[Image:]]This rule finds matches for the specified RegEx pattern, and replaces them with another string. (RegEx is short for “Regular Expressions”. See [#6.4.Appendix-D RegEx (Regular Expressions)|outline Appendix-D] to learn the RegEx syntax.)
 
  
Also visit the User forum to see a lot of RegEx patterns for various purposes.  
+
[[Image:RegExRule.png|center]]
  
The parameters are as follows:
+
This rule allows finding and replacing patterns defined as [[ReNamer:Regular Expressions|Regular Expressions]].
  
 +
Regular Expressions (RegEx) use a special syntax for describing search and replace patterns, they are very powerful and ''really'' worth learning.
  
{| class="prettytable"
+
ReNamer users have posted many RegEx examples at the [http://www.den4b.com/forum/ User Forum], where you might find your particular case already solved.
| <center>'''Parameter'''</center>
 
| <center>'''Details'''</center>
 
  
 +
'''Note:''' The RegEx engine used in ReNamer is a little different from the mainstream [http://perldoc.perl.org/perlre.html PERL RegEx] or [http://msdn.microsoft.com/en-us/library/6wzad2b2(VS.85).aspx Windows RegEx]. You can check the syntax in the [[ReNamer:Regular Expressions|Regular Expressions]] article.
 +
 +
The parameters are as follows:
 +
 +
{| class="wikitable"
 
|-
 
|-
| Expression
+
! Parameter
| RegEx pattern to match (find).
+
! Details
 
+
|-
 +
| Expression  
 +
| RegEx pattern to match or find.
 
|-
 
|-
| Replace
+
| Replace  
 
| RegEx pattern that replaces the found pattern.
 
| RegEx pattern that replaces the found pattern.
 +
|-
 +
| Skip extension
 +
| If this check box is selected, the extension will be ignored by the rule.
 +
|-
 +
| Case-sensitive
 +
| If this option is selected, ReNamer will search for the text in ''case-sensitive'' manner.
 +
|}
  
|-
+
A simple set of commonly used RegEx syntax patterns is provided in the hint menu:
| Skip extension
+
 
| If this check box is unselected, the extension will be included in the rule.
+
[[File:RegExRuleSyntaxHint.png]]
  
|}
+
[[Category:ReNamer]]

Latest revision as of 09:48, 24 January 2022

RegExRule.png

This rule allows finding and replacing patterns defined as Regular Expressions.

Regular Expressions (RegEx) use a special syntax for describing search and replace patterns, they are very powerful and really worth learning.

ReNamer users have posted many RegEx examples at the User Forum, where you might find your particular case already solved.

Note: The RegEx engine used in ReNamer is a little different from the mainstream PERL RegEx or Windows RegEx. You can check the syntax in the Regular Expressions article.

The parameters are as follows:

Parameter Details
Expression RegEx pattern to match or find.
Replace RegEx pattern that replaces the found pattern.
Skip extension If this check box is selected, the extension will be ignored by the rule.
Case-sensitive If this option is selected, ReNamer will search for the text in case-sensitive manner.

A simple set of commonly used RegEx syntax patterns is provided in the hint menu:

RegExRuleSyntaxHint.png