i found this scheme in the forum.... {ny.replaceFirst(/^(?i)(The|A|An)\ (.+[^\ \(\d{4}\)])/, /$2, $1/)}
can someone please help add the code to replace colon (:) with dash ( - )
thank you
replace colon with existing scheme
Re: replace colon with existing scheme
Code: Select all
{ny.replaceFirst(/^(?i)(The|A|An)\ (.+[^\ \(\d{4}\)])/, /$2, $1/)}
Code: Select all
{ny.replaceFirst(/^(?i)(The|A|An)\ (.+[^\ \(\d{4}\)])/, /$2, $1/).replaceAll(/:/,' - ')}
Code: Select all
{ny.replaceFirst(/^(?i)(The|A|An)\ (.+[^\ \(\d{4}\)])/, /$2, $1/).replaceAll(/[:–-]/, ' - ').replace(/:/, '.')}
btw:
https://www.filebot.net/naming.html
Last edited by kim on 25 Dec 2017, 05:27, edited 2 times in total.
Re: replace colon with existing scheme
Since, this is a fairly common request, there's also a convenience method for that:
Code: Select all
n.colon(' - ')
Re: replace colon with existing scheme
the problem with this is that 99% of English titles with ":" is like "movie: subtitle"rednoah wrote: ↑23 Dec 2017, 09:07 Since, this is a fairly common request, there's also a convenience method for that:Code: Select all
n.colon(' - ')
so "n.colon(' - ')" = double spaces
Re: replace colon with existing scheme
String.colon() takes care of that particular problem by matching white space surrounding the : colon as well.
Re: replace colon with existing scheme
O, but still needs the unicode
... because people copy/paste title in with it, I have even seen the MOD's lock title with it–