Skip to content

Commit afa94a3

Browse files
committed
Fixed bug with parsing
1 parent f8761f3 commit afa94a3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

AVPlayerViewController-Subtitles.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'AVPlayerViewController-Subtitles'
33
spec.platform = :ios, "8.0"
4-
spec.version = '1.1.0'
4+
spec.version = '1.1.1'
55
spec.license = { :type => 'Apache License, Version 2.0' }
66
spec.homepage = 'https://github.com/mhergon/AVPlayerViewController-Subtitles'
77
spec.authors = { 'Marc Hervera' => '[email protected]' }
88
spec.summary = 'Subtitles made easy'
9-
spec.source = { :git => 'https://github.com/mhergon/AVPlayerViewController-Subtitles.git', :tag => 'v1.1.0' }
9+
spec.source = { :git => 'https://github.com/mhergon/AVPlayerViewController-Subtitles.git', :tag => 'v1.1.1' }
1010
spec.source_files = 'Subtitles.swift'
1111
spec.requires_arc = true
1212
spec.module_name = 'AVPlayerViewControllerSubtitles'

Subtitles.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public extension AVPlayerViewController {
121121
let parsed = NSMutableDictionary()
122122

123123
// Get groups
124-
let regexStr = "(?m)(^[0-9]+)([\\s\\S]*?)(?=\n\n)"
124+
let regexStr = "(\\d+)\\n([\\d:,]+)\\s+-{2}\\>\\s+([\\d:,]+)\\n([\\s\\S]*?(?=\\n{2,}|$))"
125125
let regex = try NSRegularExpression(pattern: regexStr, options: .caseInsensitive)
126126
let matches = regex.matches(in: payload, options: NSRegularExpression.MatchingOptions(rawValue: 0), range: NSMakeRange(0, payload.characters.count))
127127
for m in matches {

0 commit comments

Comments
 (0)