Skip to content

Currency symbol abbreviation "Sc" is not a valid property #835

Closed
@aikow

Description

@aikow

What version of regex are you using?

1.5.4

Describe the bug at a high level.

The unicode abbreviation for for the currency symbols as defined here https://www.unicode.org/Public/UCD/latest/ucd/PropertyValueAliases.txt
is not valid and gives a regex parse error.

What are the steps to reproduce the behavior?

Add the regex crate to the cargo.toml file

File: Cargo.toml

[dependencies]
regex = "1.5.4"

File: main.rs

use regex::Regex;

fn main() {
    let regex = Regex::new(r"\p{Sc}").unwrap();
    if regex.is_match("$") {
        println!("Hello, world!");
    }
}

What is the actual behavior?

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Syntax(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
regex parse error:
    \p{Sc}
    ^^^^^^
error: Unicode property not found
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
)', src/main.rs:4:39
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

What is the expected behavior?

Expected the regex to compile and return the "$" as a match.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions