@@ -92,7 +92,7 @@ pub fn expand_bytes(
92
92
/// `CaptureRef` represents a reference to a capture group inside some text.
93
93
/// The reference is either a capture group name or a number.
94
94
///
95
- /// It is also tagged with the position in the text immediately proceeding the
95
+ /// It is also tagged with the position in the text following the
96
96
/// capture reference.
97
97
#[ derive( Clone , Copy , Debug , Eq , PartialEq ) ]
98
98
struct CaptureRef < ' a > {
@@ -204,6 +204,7 @@ mod tests {
204
204
find ! ( find_cap_ref3, "$0" , c!( 0 , 2 ) ) ;
205
205
find ! ( find_cap_ref4, "$5" , c!( 5 , 2 ) ) ;
206
206
find ! ( find_cap_ref5, "$10" , c!( 10 , 3 ) ) ;
207
+ // see https://github.com/rust-lang/regex/pull/585 for more on characters following numbers
207
208
find ! ( find_cap_ref6, "$42a" , c!( "42a" , 4 ) ) ;
208
209
find ! ( find_cap_ref7, "${42}a" , c!( 42 , 5 ) ) ;
209
210
find ! ( find_cap_ref8, "${42" ) ;
@@ -212,4 +213,8 @@ mod tests {
212
213
find ! ( find_cap_ref11, "$" ) ;
213
214
find ! ( find_cap_ref12, " " ) ;
214
215
find ! ( find_cap_ref13, "" ) ;
216
+ find ! ( find_cap_ref14, "$1-$2" , c!( 1 , 2 ) ) ;
217
+ find ! ( find_cap_ref15, "$1_$2" , c!( "1_" , 3 ) ) ;
218
+ find ! ( find_cap_ref16, "$x-$y" , c!( "x" , 2 ) ) ;
219
+ find ! ( find_cap_ref17, "$x_$y" , c!( "x_" , 3 ) ) ;
215
220
}
0 commit comments