Page 1 of 1

a Little help with Filename: Find & Replace

Posted: 21 Apr 2014, 02:13
by Zerelah
Hey I have been playing with renaming my subtitles using
http://www.filebot.net/forums/viewtopic ... &t=5#p2100

but it seems to be case sensative how would I get around that I tried adding both en|EN but that gives Englishlish
Propperly should have done a test mode first :lol:

can i get it to do both danish and english subs at the same time ?

and lastly how would I go about adding lang to subtitles that dont have it and are named as the video only I thought about a fileformat with {FN}.Lang
but if the sub has lang already it will just get another right ?

hope you can help once again

Zerelah

Re: a Little help with Filename: Find & Replace

Posted: 21 Apr 2014, 06:14
by rednoah
1.
Did you know that (?i) makes the regex case insensitive?
http://www.regular-expressions.info/modifiers.html

2.
You can't do Danish and English at the same time. Keep it simple and make 2 calls.

3.
That's a bit tricky, but I'm sure you can make it work with negative lookbehind:
http://www.regular-expressions.info/lookaround.html

Re: a Little help with Filename: Find & Replace

Posted: 21 Apr 2014, 15:35
by Zerelah
thanks Red and no I dident know that I will look in to this thank you

Re: a Little help with Filename: Find & Replace

Posted: 21 Apr 2014, 18:32
by Zerelah
Hey rednoah

I looked at the casesensative and it works but ran in to a snag if a subtitle is already maned correctly it gets an ish added

Code: Select all

filebot -script fn:replace  --filter "[.]srt$" --def "e=[.](?i)(dan|da)" "r=.Danish" "/Z:\[BluRay]\Almost Human\Season 1"
so eng or en gets renamed to English but if it is already named english it gets renamed to Englishish am I doing something horrebly wrong ?

Re: a Little help with Filename: Find & Replace

Posted: 22 Apr 2014, 02:40
by rednoah
Positive Look-ahead for [.] ;)