| Magic File Renamer Help

Index > Reference > Regular Expressions

Regular expressions are used in the Replacer Filter and the Replace List Filter, to search for a pattern of text instead of searching for a literal (static) text.
MFR uses Microsoft.Net regular expressions syntax. Browse the link for syntax specification.
The text that matched the pattern can also be extracted in the Replace With field using the specifiers: $0 specifies the whole match, $1..$9 specify captured sub-matches 1 to 9. Sub-matches are captures using ( ) metacharacters.
The button to the right of the search and replace text boxes let you input commonly used regular expressions specifiers to the text box.
Examples:

Search Regular Expression | Replace String | Source String | Target String
`[0-9]+_-_` | (blank) | `14_-_Tears_For_Fears_-_Pharaohs` | `Tears_For Fears_-_Pharaohs`
`\(.*\)` | `BOOM` | `ab(c)d` | `abBOOMd`
`\((.*)\)` | `$1` | `ab(c)d` | `abcd`
`jpeg|jpe|JPE|JPEG|JPG` | `jpg` | `house.jpe` | `house.jpg`
`^[0-9]+` | `_` | `02Track2` | `_Track2`