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

Fix regex look-ahead / look-behind issues (esp. to fix 01v2 numeric matching issues)

This commit is contained in:
Reinhard Pointner 2019-01-31 20:46:02 +07:00
parent 9e0366bd64
commit edd1618849
2 changed files with 2 additions and 1 deletions

View File

@ -302,7 +302,7 @@ public class ReleaseInfo {
public Pattern getVideoFormatPattern(boolean strict) {
// pattern matching any video source name
String pattern = getProperty("pattern.video.format");
return strict ? compileWordPattern(pattern) : compile(pattern, CASE_INSENSITIVE);
return strict ? compile("(?<!\\p{Alpha})(" + pattern + ")(?!\\p{Alpha})", CASE_INSENSITIVE) : compile(pattern, CASE_INSENSITIVE);
}
public Pattern getVideoSourcePattern() {

View File

@ -18,6 +18,7 @@ public class MediaDetectionTest {
@Test
public void stripFormatInfo() throws Exception {
assertEquals("One Piece 01", MediaDetection.stripFormatInfo("One Piece 01v2 1080p"));
assertEquals("3.Idiots.PAL.DVD..", MediaDetection.stripFormatInfo("3.Idiots.PAL.DVD.DD5.1.x264"));
}