Skip to main content

Using regular expressions in rules

Extract parts of a filename and reuse them in rule actions.

The matches comparison supports regular expressions. You can name captured parts of the text and reuse them as tags in an action.

Example: extract a series name

For filenames such as Example Show.S02E05.mkv, create an On File Load rule and compare Original Filename using matches:

('my_show'.+)[sS]('my_season'[0-9]+)[eE]('my_episode'[0-9]+)

The named groups are my_show, my_season and my_episode. In an action, set the show field to:

{my_show}

iFlicks turns this into a tag referring to the captured value. You can use the other captured values in appropriate actions too.

The named-group notation ('name'...) is specific to iFlicks and differs from the notation used by many regular-expression tools. Test a matching and a nonmatching filename before enabling the rule for a whole folder.

Was this article helpful?