mirror of
https://github.com/mitb-archive/filebot
synced 2025-01-08 12:28:04 -05:00
Fix regex look-ahead / look-behind issues (esp. to fix 01v2 numeric matching issues)
This commit is contained in:
parent
9e0366bd64
commit
edd1618849
@ -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() {
|
||||
|
@ -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"));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user