Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #4 from seatcode/hotfix/0.4.1
Browse files Browse the repository at this point in the history
Fix Apple's Foundation String formatSpecifier shouldn't support spaces
  • Loading branch information
CSolanaM authored Apr 8, 2020
2 parents 4c5c95e + 014c3b7 commit 283568d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extension String {
//
// See https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions?view=vs-2017#flags
// See https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html
let pattern = "%(-|\\+|0| |#)*(\\*|[1-9]+){0,1}(\\.[0-9]+){0,1}(hh|h|l|L|ll|t|w|z|I|I32|I64){0,1}([0-9]\\$){0,1}(@|c|C|d|i|o|u|x|X|e|E|f|F|g|G|a|a|n|p|s|S|Z)"
let pattern = "%(-|\\+|0|#)*(\\*|[1-9]+){0,1}(\\.[0-9]+){0,1}(hh|h|l|L|ll|t|w|z|I|I32|I64){0,1}([0-9]\\$){0,1}(@|c|C|d|i|o|u|x|X|e|E|f|F|g|G|a|a|n|p|s|S|Z)"

return try matches(regex: pattern)
}
Expand Down

0 comments on commit 283568d

Please sign in to comment.