Closed
Description
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
Labels
No labels