[SNIPPET] Match information from the file path

All about user-defined episode / movie format expressions
Post Reply
User avatar
rednoah
The Source
Posts: 19920
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

[SNIPPET] Match information from the file path

Post by rednoah »

String.match() can be used to match regex patterns from unstructured text.


Copy information from the current file name into the destination file name:

e.g. match 720p / 1080p / etc patterns from the current file name: 1080p

Code: Select all

{ fn.match(/[0-9]{3,4}p/) }
e.g. match an entire section of the current file name: .1080p.AMZN.WEB-DL.DDP5.1.H.264-TEPES

Code: Select all

{ fn.match(/.[0-9]{3,4}p.+/) }
:idea: Use regexr if you need to customize the pattern to better match your files.
:idea: Please read the FAQ and How to Request Help.
Post Reply