Feel free to close if this is really behaving as expected.
The following code:
extern crate regex;
use regex::Regex;
fn main() {
let mut result = " pub mErrorLine: root::nsTString<u16>,".to_owned();
let r = Regex::new(r"\broot::nsTString<u16>\b").unwrap();
result = r.replace_all(&result, "::nsstring::nsStringRepr").to_string();
println!("{:?}", result);
}
Will not be able to replace the root::nsTString<u16>, while removing the last \b from the regex does.