mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
21 lines
568 B
Swift
21 lines
568 B
Swift
//
|
|
// NSRegularExpression+SwiftLint.swift
|
|
// SwiftLint
|
|
//
|
|
// Created by Scott Hoyt on 1/21/16.
|
|
// Copyright © 2016 Realm. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public extension NSRegularExpression {
|
|
public convenience init(pattern: String) throws {
|
|
try self.init(pattern: pattern,
|
|
options: [.AnchorsMatchLines, .DotMatchesLineSeparators])
|
|
}
|
|
public static func forcePattern(pattern: String) -> NSRegularExpression {
|
|
// swiftlint:disable:next force_try
|
|
return try! NSRegularExpression(pattern: pattern)
|
|
}
|
|
}
|