From 135133e4c29e00e356724ba143905374d6f6f416 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 22 Jun 2013 07:47:51 -0700 Subject: [PATCH] Allow garbage after the timestamp in SRT files. Updates #1614. --- aegisub/src/subtitle_format_srt.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aegisub/src/subtitle_format_srt.cpp b/aegisub/src/subtitle_format_srt.cpp index fd5112fc5..ff6d446c0 100644 --- a/aegisub/src/subtitle_format_srt.cpp +++ b/aegisub/src/subtitle_format_srt.cpp @@ -384,13 +384,13 @@ void SRTSubtitleFormat::ReadFile(AssFile *target, agi::fs::path const& filename, state = STATE_TIMESTAMP; break; } - if (regex_match(text_line, timestamp_match, timestamp_regex)) + if (regex_search(text_line, timestamp_match, timestamp_regex)) goto found_timestamps; throw SRTParseError(str(boost::format("Parsing SRT: Expected subtitle index at line %d") % line_num), 0); case STATE_TIMESTAMP: - if (!regex_match(text_line, timestamp_match, timestamp_regex)) + if (!regex_search(text_line, timestamp_match, timestamp_regex)) throw SRTParseError(str(boost::format("Parsing SRT: Expected timestamp pair at line %d") % line_num), 0); found_timestamps: if (line) { @@ -443,7 +443,7 @@ found_timestamps: state = STATE_TIMESTAMP; break; } - if (regex_match(text_line, timestamp_match, timestamp_regex)) + if (regex_search(text_line, timestamp_match, timestamp_regex)) goto found_timestamps; // assume it's a continuation of the subtitle text