Skip to content

Commit

Permalink
Fix regex interpolation search for emoji strings (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaandedeoglu authored Apr 24, 2021
1 parent 849db4c commit 45aa2bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Shark/LocalizationEnumBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ private enum LocalizationValue: Comparable {

private static func interpolationTypes(forValue value: String) throws -> [InterpolationType] {
let regex = try NSRegularExpression(pattern: "%([0-9]*.[0-9]*(d|i|u|f|ld)|(\\d\\$)?@|d|i|u|f|ld)", options: [])
let results = regex.matches(in: value, options: [], range: NSRange(location: 0, length: value.count))

let results = regex.matches(in: value, options: [], range: NSRange(location: 0, length: value.utf16.count))
return results.map { (value as NSString).substring(with: $0.range) }.map(InterpolationType.init)
}
}
Expand Down

0 comments on commit 45aa2bb

Please sign in to comment.