Page 1 of 1

Need help with my Format to detect word between [ ]

Posted: 17 Mar 2023, 12:16
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

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

Posted: 17 Mar 2023, 12:51
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]