1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00

Reduce String.replacePart() false positive rate

https://www.filebot.net/forums/viewtopic.php?f=5&t=4068&p=32229#p32229
This commit is contained in:
Reinhard Pointner 2018-02-05 13:55:33 +07:00
parent 0649adca00
commit 8563ae349f

View File

@ -328,7 +328,7 @@ public class ExpressionFormatMethods {
public static String replacePart(String self, String replacement) {
// handle '(n)', '(Part n)' and ': Part n' like syntax
String[] patterns = new String[] { "\\s*[(](\\w+)[)]$", "\\W+Part (\\w+)\\W*$" };
String[] patterns = new String[] { "\\s*[(](\\w{1,3})[)]$", "\\W+Part (\\w+)\\W*$" };
for (String pattern : patterns) {
Matcher matcher = compile(pattern, CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS).matcher(self);