garde icon indicating copy to clipboard operation
garde copied to clipboard

Error parsing `regex` : `Unicode-aware Perl class not found`

Open michaelbeaumont opened this issue 2 months ago • 1 comments

In spite of enabling the regex and unicode features:

error: invalid regex: regex parse error:
           ^(\d{1,5}|\d{1,5}-\d{1,5})$
             ^^
       error: Unicode-aware Perl class not found (make sure the unicode-perl feature is enabled)
  --> openapi/src/models/listener_config_ports_inner.rs:21:20
   |
21 |            pattern("^(\\d{1,5}|\\d{1,5}-\\d{1,5})$"),

The error goes away when I enable phonenumber, I'm assuming because phonenumber depends on regex with default features.

Maybe unicode should enable some of the unicode-* features of regex?

michaelbeaumont avatar Oct 08 '25 13:10 michaelbeaumont

You can configure features for regex by adding it as a direct dependency in your own crate, and enabling the missing features. The unicode feature here is for validating unicode strings. I understand why it's misleading, but I'd like to keep things as they are

jprochazk avatar Oct 08 '25 15:10 jprochazk