Need help with my Format to detect word between [ ]

Any questions? Need some help?
Post Reply
FTW
Posts: 39
Joined: 28 Jan 2022, 09:47

Need help with my Format to detect word between [ ]

Post by FTW »

Hi, so I need to rename all my TV/Movie again because my older don't have the new {tvdb-xx} and want to add them but my issue is, I want Filebot to detect the word MULTi, QC inside [ ]

as example ->
TV name:

Code: Select all

A Girl and an Astronaut {tvdb-418930}/Season 01/A Girl and an Astronaut - S01E02 - Episode 2 [MULTI] [1080p].mkv
Format Use for this example:

Code: Select all

{anime =~ /true/ ? 'ANiMES-FR' : {genres =~ /Animation/ ? 'SERiES-ANiMATiON' : {genres =~ /Children/ ? 'SERiES-ANiMATiON' : {genres =~ /Documentary/ ? 'TV-DOC' : 'TV-FR' }}}}/{~plex.id % {" ${file.name.matchAll(/(TRUEFRENCH)|(MULTi)|(SUBFRENCH)|(CUSTOM)|\.(QC)\./)}"} % {" ${VF =~ '720p' ? '[720p]' : ''}"} % {" ${VF =~ '1080p' ? '[1080p]' : ''}"} % {" ${file.name.matchAll(/REAL.PROPER|PROPER|REAL.REPACK|REPACK|RERIP|SUBFIX/)}"} }
it will detect MULTi but if I have a name like -> Mila in The Multiverse - S01E02 - Episode 2.mkv -> because of the word Multi, it will put the tag [MULTI] as I asked for in the format

but how I can ask to look the word MULTi only between the Bracket

Code: Select all

[ ] -> ${file.name.matchAll(/(TRUEFRENCH)|(MULTi)|(SUBFRENCH)|(CUSTOM)|\.(QC)\./)}
I am unable to put [ ] in the format

Thanks
Best Regards
User avatar
rednoah
The Source
Posts: 23469
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Need help with my Format to detect word between [ ]

Post by rednoah »

[...] is regex code, so you need to escape those characters accordingly.

e.g.

Code: Select all

{ fn.match(/\[MULTI\]/) }

Test Case:

Code: Select all

{ '[MULTI]'.match(/\[MULTI\]/) }

Code: Select all

[MULTI]
:idea: Please read the FAQ and How to Request Help.
Post Reply