Skip to content

i can't figure why regex don't compile #885

@SMods11

Description

@SMods11

What version of regex are you using?

1.6.0

Describe the bug at a high level.

my regex \\"vault\\"\\:[\\"]?(\\{.*?data.*?\\}) compile with nodejs but seem to have a problem with this library.

What are the steps to reproduce the behavior?

use regex::Regex;

fn main() {
    let regex = Regex::new(r#"\\"vault\\"\\:[\\"]?(\\{.*?data.*?\\})"#).unwrap();
    let string = r#"roller":{"vault":"{\\"data\\":\\"nac2xYOoNouaNXgx11iiwYLW\\",\\"iv\\":\\"0/h9/3zXRzIALeXu6tHyRA==\\",\\"salt\\":\\"R7eS1IV7k6maUUNivx86OHT/hHhUFpXZgW3Ip1vFp+I=\\"}"}"#;

    let result = regex.captures_iter(string);

    for mat in result {
        println!("{:?}", mat);
    }
}

What is the actual behavior?

hread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Syntax(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
regex parse error:
    \\"vault\\"\\:[\\"]?(\\{.*?data.*?\\})
                            ^
error: repetition quantifier expects a valid decimal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
)', src\main.rs:4:73

What is the expected behavior?

"vault":"{\\"data\\":\\"nac2xYOoNouaNXgx11iiwYLW\\",\\"iv\\":\\"0/h9/3zXRzIALeXu6tHyRA==\\",\\"salt\\":\\"R7eS1IV7k6maUUNivx86OHT/hHhUFpXZgW3Ip1vFp+I=\\"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions