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] }

Activity

changed the title [-]RegexSet don't respect the ^ anchor[/-] [+]RegexSet doesn't respect the ^ anchor[/+] on May 1, 2017
added a commit that references this issue on May 20, 2017
be9653c
BurntSushi

BurntSushi commented on May 20, 2017

@BurntSushi
Member

This is a literal optimization bug.

added a commit that references this issue on May 20, 2017

Auto merge of #370 - BurntSushi:ag-fix-358, r=BurntSushi

bedc221
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @kalekseev@BurntSushi

      Issue actions

        RegexSet doesn't respect the ^ anchor · Issue #358 · rust-lang/regex