 
     // MARK: - Matching
     func testMatchesBool() {
-        let regex: Regex = "[1-9]+"
-        XCTAssertTrue(regex.matches("5"))
+        let regex = try? Regex("[1-9]+")
+        XCTAssertTrue(regex!.matches("5"))
     }
 
     func testFirstMatch() {
-        let regex: Regex = "[1-9]+"
-        XCTAssertEqual(regex.firstMatch(in: "5 3 7")?.string, "5")
+        let regex = try? Regex("[1-9]?+")
+        XCTAssertEqual(regex?.firstMatch(in: "5 3 7")?.string, "5")
     }
 
     func testMatches() {
-        let regex: Regex = "[1-9]+"
-        XCTAssertEqual(regex.matches(in: "5 432 11").map { $0.string }, ["5", "432", "11"])
+        let regex = try? Regex("[1-9]+")
+        XCTAssertEqual(regex?.matches(in: "5 432 11").map { $0.string }, ["5", "432", "11"])
     }
 
     func testReplacingMatches() {
-        let regex: Regex = "([1-9]+)"
+        let regex = try? Regex("([1-9]+)")
 
-        let stringAfterReplace1 = regex.replacingMatches(in: "5 3 7", with: "2")
-        let stringAfterReplace2 = regex.replacingMatches(in: "5 3 7", with: "$1")
-        let stringAfterReplace3 = regex.replacingMatches(in: "5 3 7", with: "1$1,")
-        let stringAfterReplace4 = regex.replacingMatches(in: "5 3 7", with: "2", count: 5)
-        let stringAfterReplace5 = regex.replacingMatches(in: "5 3 7", with: "2", count: 2)
+        let stringAfterReplace1 = regex?.replacingMatches(in: "5 3 7", with: "2")
+        let stringAfterReplace2 = regex?.replacingMatches(in: "5 3 7", with: "$1")
+        let stringAfterReplace3 = regex?.replacingMatches(in: "5 3 7", with: "1$1,")
+        let stringAfterReplace4 = regex?.replacingMatches(in: "5 3 7", with: "2", count: 5)
+        let stringAfterReplace5 = regex?.replacingMatches(in: "5 3 7", with: "2", count: 2)
 
         XCTAssertEqual(stringAfterReplace1, "2 2 2")
         XCTAssertEqual(stringAfterReplace2, "5 3 7")

    }

    func testMatchStringApplyingTemplate() {
        let regex: Regex = "([1-9])(Needed)"
        let match = regex.firstMatch(in: "1Needed")
        XCTAssertEqual(match?.string(applyingTemplate: "Test$1ThatIs$2"), "Test1ThatIsNeeded")
    }


class RegexTests: XCTestCase {
    // MARK: - Initialization
    func testValidInitialization() {
        XCTAssertNoThrow({ try Regex("abc") }) // swiftlint:disable:this trailing_closure
    }

