Skip to content

Instantly share code, notes, and snippets.

View apbendi's full-sized avatar

Ben DiFrancesco apbendi

View GitHub Profile
@apbendi
apbendi / Regex.swift
Last active January 3, 2016 13:59 — forked from ningsuhen/Regex.swift
Swift extension for Native String class to support Regex match and Regex replace. Credit - http://www.swift-studies.com/blog/2014/6/12/regex-matching-and-template-replacement-operators-in-swift *Updated for Swift 2.0*
import Foundation
struct Regex {
var pattern: String {
didSet {
updateRegex()
}
}
var expressionOptions: NSRegularExpressionOptions {
didSet {