Skip to content

Trying to reference the Cf category generates an error #719

Closed
@justinmchase

Description

@justinmchase

If I use the unicode class cf:

static ref RE: Regex = Regex::new(r"^[\p{cf}]$").unwrap();

It generates this error:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
regex parse error:
    ^[\p{cf}]$
      ^^^^^^
error: Unicode property not found
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
)', src/runtime/modules/unicode.rs:21:28

But I see the format is here in the code:
https://github.com/rust-lang/regex/blob/master/regex-syntax/src/unicode_tables/property_values.rs#L72

If I change the regex to be \p{Format} then it actually works. This is a little confusing to me, can someone please explain why \p{cf} doesn't work?

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