Skip to content

Commit 23d9f44

Browse files
committed
Retract ~= for Regex.
We'd like to provide this, but we haven't been able to reach agreement on what the semantics actually ought to be. The original version used wholeMatch; contains is arguably more flexible, but feels less natural when compared to how ~= is used for other types in the language. Additionally, we'd like to investigate the possibility of using named captures to effect bindings in case statements in the future, and we don't want to wall ourselves off from that until we've had time to think about it some more.
1 parent 290ce10 commit 23d9f44

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

Sources/_StringProcessing/Regex/Match.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,3 @@ extension BidirectionalCollection where SubSequence == Substring {
177177
try? r.regex.prefixMatch(in: self[...])
178178
}
179179
}
180-
181-
@available(SwiftStdlib 5.7, *)
182-
extension RegexComponent {
183-
public static func ~=(regex: Self, input: String) -> Bool {
184-
input.wholeMatch(of: regex) != nil
185-
}
186-
187-
public static func ~=(regex: Self, input: Substring) -> Bool {
188-
input.wholeMatch(of: regex) != nil
189-
}
190-
}

0 commit comments

Comments
 (0)