Skip to content

Commit

Permalink
fix lyrics filter with regex
Browse files Browse the repository at this point in the history
fix #468
  • Loading branch information
ddddxxx committed Feb 18, 2021
1 parent 32c2af7 commit 67868b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion LyricsX/Utility/Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private extension NSPredicate {
let predicates = change.newValue.compactMap { (key: String) -> NSPredicate? in
let isRegex = key.hasPrefix("/")
let pattern = isRegex ? String(key.dropFirst()) : key
let options: NSRegularExpression.Options = isRegex ? [.ignoreMetacharacters] : []
let options: NSRegularExpression.Options = isRegex ? [] : [.ignoreMetacharacters]
guard let regex = try? Regex(pattern, options: options) else { return nil }
return NSPredicate { object, _ in
guard let object = object as? LyricsLine else { return false }
Expand Down

0 comments on commit 67868b3

Please sign in to comment.