Page 1 of 1

Can you remove the country code from: info.network?

Posted: 08 Jun 2019, 16:51
by DevXen
Hey!

Is there an easy way to remove the Country code from: info.network?

Ideally, i'd like to move the country code from that section and put it in it's own, if it's not US.

[ABC (AU)] - Remove (AU) and add it maybe just after that section [ABC] (AU)
[CBC (CA)] - Remove (CA) and add it maybe just after that section [CBC] (CA)
[Sky Atlantic (UK)] - Remove (UK) and add it maybe just after that section [Sky Atlantic] (UK)
[Comedy Central (US)] - it's in the US so just remove it: [Comedy Central]

By easy I am hoping for a way that doesn't involve a massive match/replace line for each possible tv station and country. haha.

Manually Fixing it on each file/folder and hoping I notice them is just gettting exhauting. haha.

Thanks,
-Clint

Re: Can you remove the country code from: info.network?

Posted: 08 Jun 2019, 17:23
by rednoah
This should do:

Code: Select all

{info.network.replaceTrailingBrackets()}

Re: Can you remove the country code from: info.network?

Posted: 08 Jun 2019, 20:50
by kim

Code: Select all

{info.network.replaceAll(/(.+)\s(\(.+\))/, '[$1]$2').replaceAll(/\(US\)/)}
https://regex101.com/r/mwoyui