-
Notifications
You must be signed in to change notification settings - Fork 480
Description
I hadn't worked with rust in months so I made major updates of both rustc and my dependencies (including regex). I noticed that my program was now failing in a weird way and I finally tracked it down to this bug (regression?), either that or I'm doing something very wrong here:
let re = Regex::new(r"(^\.)|(~$)").unwrap();
assert!(!re.is_match("favicon.png"));
That assertion is failing even though it shouldn't AFAIK. It certainly didn't before.
The regex is supposed to match if the string begins with .
or ends with ~
. Even without the groupings/capture groups it fails. Somehow it is matching on "favicon.png"
.
I can't imagine something like this got through though so I'm thinking it may be a misunderstanding I have of how that regex should work. I tried this just now in the chrome console with javascript and I don't see this problem there, though I am aware that regex implementations tend to differ, I wasn't aware that they differ in something like this.