1010//===----------------------------------------------------------------------===//
1111
1212@dynamicMemberLookup
13- public struct RegexMatch < Match> {
13+ public struct MatchResult < Match> {
1414 let input : String
1515 public let range : Range < String . Index >
1616 let rawCaptures : [ StructuredCapture ]
@@ -64,11 +64,11 @@ public struct RegexMatch<Match> {
6464}
6565
6666extension RegexComponent {
67- public func match( in input: String ) -> RegexMatch < Match > ? {
67+ public func match( in input: String ) -> MatchResult < Match > ? {
6868 _match (
6969 input, in: input. startIndex..< input. endIndex)
7070 }
71- public func match( in input: Substring ) -> RegexMatch < Match > ? {
71+ public func match( in input: Substring ) -> MatchResult < Match > ? {
7272 _match (
7373 input. base, in: input. startIndex..< input. endIndex)
7474 }
@@ -77,7 +77,7 @@ extension RegexComponent {
7777 _ input: String ,
7878 in inputRange: Range < String . Index > ,
7979 mode: MatchMode = . wholeString
80- ) -> RegexMatch < Match > ? {
80+ ) -> MatchResult < Match > ? {
8181 let executor = Executor ( program: regex. program. loweredProgram)
8282 do {
8383 return try executor. match ( input, in: inputRange, mode)
@@ -88,24 +88,24 @@ extension RegexComponent {
8888}
8989
9090extension String {
91- public func match< R: RegexComponent > ( _ regex: R ) -> RegexMatch < R . Match > ? {
91+ public func match< R: RegexComponent > ( _ regex: R ) -> MatchResult < R . Match > ? {
9292 regex. match ( in: self )
9393 }
9494
9595 public func match< R: RegexComponent > (
9696 @RegexComponentBuilder _ content: ( ) -> R
97- ) -> RegexMatch < R . Match > ? {
97+ ) -> MatchResult < R . Match > ? {
9898 match ( content ( ) )
9999 }
100100}
101101extension Substring {
102- public func match< R: RegexComponent > ( _ regex: R ) -> RegexMatch < R . Match > ? {
102+ public func match< R: RegexComponent > ( _ regex: R ) -> MatchResult < R . Match > ? {
103103 regex. match ( in: self )
104104 }
105105
106106 public func match< R: RegexComponent > (
107107 @RegexComponentBuilder _ content: ( ) -> R
108- ) -> RegexMatch < R . Match > ? {
108+ ) -> MatchResult < R . Match > ? {
109109 match ( content ( ) )
110110 }
111111}
0 commit comments