We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Regex("\r?\n") and other variants don't match "\r\n":
print(try #/\r?\n/#.firstMatch(in: "\r\n") == nil ? "not matched" : "matched") // prints "not matched"
See more "not matching" variants, and some related "matching" ones, in the reproduction section below.
print(try #/\r?\n/#.firstMatch(in: "\n") == nil ? "not matched" : "matched") // prints "matched" print(try #/\r?\n/#.firstMatch(in: "\n") == nil ? "not matched" : "matched") // prints "matched" print(try #/(\r)?\n/#.firstMatch(in: "\n") == nil ? "not matched" : "matched") // prints "matched" print(try #/\r{0,1}\n/#.firstMatch(in: "\n") == nil ? "not matched" : "matched") // prints "matched" print(try #/(\r){0,1}\n/#.firstMatch(in: "\n") == nil ? "not matched" : "matched") // prints "matched" print(try #/\r?\n/#.firstMatch(in: "\r\n") == nil ? "not matched" : "matched") // prints "not matched" print(try #/(\r)?\n/#.firstMatch(in: "\r\n") == nil ? "not matched" : "matched") // prints "not matched" print(try #/\r{0,1}\n/#.firstMatch(in: "\r\n") == nil ? "not matched" : "matched") // prints "not matched" print(try #/(\r){0,1}\n/#.firstMatch(in: "\r\n") == nil ? "not matched" : "matched") // prints "not matched" print(try #/\r\n/#.firstMatch(in: "\r\n") == nil ? "not matched" : "matched") // prints "matched" print(try Regex("\r?\n").firstMatch(in: "\n") == nil ? "not matched" : "matched") // prints "matched" print(try Regex("\r?\n").firstMatch(in: "\r\n") == nil ? "not matched" : "matched") // prints "not matched" print(try Regex("\r\n").firstMatch(in: "\r\n") == nil ? "not matched" : "matched") // prints "matched"
I expect all the "not matched" lines above to print "matched"
swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5) Target: arm64-apple-macosx14.0
Xcode 15.2 (15C500b) macOS Sonoma 14.2.1 Mac mini M2 2023
The text was updated successfully, but these errors were encountered:
@hamishknight Does this need a transfer?
Sorry, something went wrong.
No branches or pull requests
Description
Regex("\r?\n") and other variants don't match "\r\n":
See more "not matching" variants, and some related "matching" ones, in the reproduction section below.
Reproduction
Expected behavior
I expect all the "not matched" lines above to print "matched"
Environment
swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0
Additional information
Xcode 15.2 (15C500b)
macOS Sonoma 14.2.1
Mac mini M2 2023
The text was updated successfully, but these errors were encountered: