Skip to content

Commit 00ac97c

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 3eb9985 commit 00ac97c

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
@@ -166,14 +166,3 @@ extension BidirectionalCollection where SubSequence == Substring {
166166
try? r.regex.prefixMatch(in: self[...])
167167
}
168168
}
169-
170-
@available(SwiftStdlib 5.7, *)
171-
extension RegexComponent {
172-
public static func ~=(regex: Self, input: String) -> Bool {
173-
input.wholeMatch(of: regex) != nil
174-
}
175-
176-
public static func ~=(regex: Self, input: Substring) -> Bool {
177-
input.wholeMatch(of: regex) != nil
178-
}
179-
}

0 commit comments

Comments
 (0)