1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-23 08:18:52 -05:00

Replace slash and backslash to make sure the result is not a file path.

This commit is contained in:
Reinhard Pointner 2016-05-04 23:27:49 +08:00
parent 38d4e7c250
commit 0acd0e885a

View File

@ -146,6 +146,15 @@ public class ExpressionFormatMethods {
return compile("\\s*[:]\\s*", UNICODE_CHARACTER_CLASS).matcher(self).replaceAll(replacement);
}
/**
* Replace slash and backslash to make sure the result is not a file path.
*
* e.g. "V_MPEG4/ISO/AVC" -> "V_MPEG4.ISO.AVC"
*/
public static String slash(String self, String replacement) {
return compile("\\s*[\\\\/]+\\s*", UNICODE_CHARACTER_CLASS).matcher(self).replaceAll(replacement);
}
/**
* Upper-case all initials.
*