Fixe base 64 regex format.
This commit is contained in:
parent
9cb4d0f50e
commit
189e5181a5
|
@ -11,7 +11,7 @@ import Foundation
|
||||||
extension String {
|
extension String {
|
||||||
|
|
||||||
func isBase64() -> Bool {
|
func isBase64() -> Bool {
|
||||||
let base64Predicate = NSPredicate(format: "SELF MATCHES %@", "^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$")
|
let base64Predicate = NSPredicate(format: "SELF MATCHES %@", "^[a-zA-Z0-9+/]{43}=$")
|
||||||
return base64Predicate.evaluate(with: self)
|
return base64Predicate.evaluate(with: self)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue