Instantly share code, notes, and snippets.

Embed
What would you like to do?
let emailPattern = "([A-Za-z0-9_\\-\\.\\+])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]+)"
let style = StyleRegEx(pattern: emailPattern) {
$0.color = UIColor.red
$0.backColor = UIColor.yellow
}
let str = "My email is hello@danielemargutti.com and my website is http://www.danielemargutti.com".(style: style!)
self.label?.attributedText = str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment