[SNIPPET] Match information from the file path
Posted: 07 Jun 2021, 10:47
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
e.g. match an entire section of the current file name: .1080p.AMZN.WEB-DL.DDP5.1.H.264-TEPES
e.g. match keyword from the file name:
e.g. match everything between the brackets: [2160p BluRay H.265 10bit HDR] [Group]
Use regexr if you need to customize the pattern to better match your files.
String.matchAll() can be used to match multiple values:
String.before() and String.after() can be used to match text before or after the given regex pattern:
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
Format: Select all
{ fn.match(/[0-9]{3,4}p/) }
Format: Select all
{ fn.match(/.[0-9]{3,4}p.+/) }
Format: Select all
{ '.' + fn.match(/PROPER|REMUX/) }
Format: Select all
{ fn.match(/\[.*\]/) }
String.matchAll() can be used to match multiple values:
Format: Select all
{ fn.matchAll(/REMASTERED|THEATRICAL|DC/) }
String.before() and String.after() can be used to match text before or after the given regex pattern:
Format: Select all
{ fn.after(/S[0-9]+E[0-9]+/) }