Created
September 18, 2015 00:04
-
-
Save swaroopjcse/725e3856dadabea0bc3a to your computer and use it in GitHub Desktop.
Nice shorthand to match RegEx in Swift; courtesy http://www.benscheirman.com/2014/06/regex-in-swift/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if let _ = password.rangeOfString("(some-regex)", options: .RegularExpressionSearch) { | |
// RegEx matches | |
} else { | |
// RegEx does not match | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment