Page 1 of 1

Quick question about leading "The"

Posted: 10 Sep 2023, 07:24
by Franky
When I have a title with both "The" at the start AND a sub-title, for example "The Mummyː Tomb of the Dragon Emperor (2008)", it currently moved the "The" to the end of the complete title, like this "Mummyː Tomb of the Dragon Emperor, The (2008)"
I'd prefer to put the moved "The" to before the subtitle, like so: "Mummy, Theː Tomb of the Dragon Emperor (2008)". Is there an easy way to do that?

Here's my expression:

Code: Select all

{n.replace(
    '<' : '﹤',
    '>' : '﹥',
    ':' : 'ː',
    '"' : '“',
    '/' : '⁄',
    '|' : '⼁',
    '?' : '﹖',
    '*' : '﹡',
    '\\': '∖'
).replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)} {'('+y+')'}
{' - '+vf.removeAll(/p/)}
{self.video[0].scantype ? self.video[0].scantype[0].lower() : 'p'}
{' '+self.video[0].formatcommercial.match(/MPEG-[1,2]/) ? self.video[0].formatcommercial.removeAll(/ Video/) : null}
{' '+video[0].formatString.removeAll(/ Visual|MPEG Video/)}
{if (hdr=="Dolby Vision" && video[0].HDRformatprofile =~ "05")" DV5" else ""}
{if (hdr=="Dolby Vision" && video[0].HDRformatprofile =~ "06")" DV6" else ""}
{if (hdr=="Dolby Vision" && video[0].HDRformatprofile =~ "07")" DV7" else ""}
{if (hdr=="Dolby Vision" && video[0].HDRformatprofile =~ "08")" DV" else ""}
{self.video[0].transfer_characteristics.match(/HLG/) ? ' HLG' : null}
{self.hdr ? ' '+self.video[0].HDR_Format_Compatibility.match(/HDR10\+|HDR10/) : self.bitdepth == 10 ? ' 10bit' : null}
{fps.value > 31 ? ' '+fps.value.round()+'fps' : null}
{', ' + aco.replaceAll('Layer 3','MP3').replaceAll('Layer 2','MP2').replaceAll('Dolby Digital','AC3').replaceAll(' Plus','+').replaceAll('Master Audio','MA').replaceAll('Atmos',' Atmos').removeAll(/Dolby | with | Discrete| Matrix| High Resolution Audio| \+ DTS/).replace(
    '<' : '﹤',
    '>' : '﹥',
    ':' : 'ː',
    '"' : '“',
    '/' : '⁄',
    '|' : '⼁',
    '?' : '﹖',
    '*' : '﹡',
    '\\': '∖'
) }
{' '+channels}
{' ('+audio.first().LanguageString2+')'}
{' ['+vs+']'}
{fn.match(/_new/) ? '[C]' : null}
{fn.match(/\[C\]/)}
{ any{ ' '+fn.match(/\{edition-.*\}/) }{ " {edition-${tags[0]}}".removeAll(/\]|\[/) } }
{fn.match(/ - pt\d/)}
{ fn.match(/disc\d/)}
{subt}

Re: Quick question about leading "The"

Posted: 10 Sep 2023, 09:02
by rednoah
e.g.

Format: Select all

{ 'The X: Y'.replaceFirst(/^(?i)(The|A|An)\s(.+?)(?=:|$)/, /$2, $1/) }

Code: Select all

X, The: Y

Re: Quick question about leading "The"

Posted: 11 Sep 2023, 12:04
by Franky
Cool, thanks!