You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using a _ in the replacement string of Regex::replace leads to unexpected behaviour. The _ seems to be treated as a backspace. The documentation should either make mention of this, or this seems to be a bug.
#[test]fnreplacement_with_underscore(){let re = regex!(r"(.)(.)");let s1 = re.replace("ab","$1-$2");let s2 = re.replace("ab","$1_$2");assert_eq!("a-b",&s1);assert_eq!("a_b",&s2);// Fails here "a_b" != "b"}