Skip to content

0.1.47 changed matching of \r #153

@DanielKeep

Description

@DanielKeep

Given the following program:

extern crate regex;
fn main() {
    let re = regex::Regex::new(r"^(.*?)(\n|\r\n?|$)").unwrap();
    println!("{:?}", re.find("ab\rcd"));
}

and rustc nightly 2bd875d3d4a9f06a4a18325d6e4a68b5234a09f6 (2016-01-19), version 0.1.46 of regex outputs:

Some((0, 3))

Version 0.1.47 outputs:

Some((0, 5))

I'm not sure what's going on here, but my understanding is that the new interpretation is wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions