Skip to content

RegexSet doesn't respect the ^ anchor #358

Closed
@kalekseev

Description

@kalekseev

Compiled with regex 0.2.1

    println!("{:?}", RegexSet::new(&[r"^rooted$"]).unwrap().matches("notrooted"));
    println!("{:?}", RegexSet::new(&[r"^rooted$", r".log$"]).unwrap().matches("notrooted"));
    println!("{:?}", RegexSet::new(&[r"^rooted$", r"\.log$"]).unwrap().matches("notrooted"));
    println!("{:?}", RegexSet::new(&[r"^rooted$", r"\.log$"]).unwrap().matches("notrootedend"));

Output:

SetMatches { matched_any: false, matches: [false] }
SetMatches { matched_any: false, matches: [false, false] }
SetMatches { matched_any: true, matches: [true, false] } 
SetMatches { matched_any: false, matches: [false, false] }

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