MCPcopy Create free account
hub / github.com/davidblewett/rure-python / allow_invalid_utf8

Method allow_invalid_utf8

regex/regex-syntax/src/hir/translate.rs:66–72  ·  view source on GitHub ↗

When enabled, translation will permit the construction of a regular expression that may match invalid UTF-8. When disabled (the default), the translator is guaranteed to produce an expression that will only ever match valid UTF-8 (otherwise, the translator will return an error). Perhaps surprisingly, when invalid UTF-8 isn't allowed, a negated ASCII word boundary (uttered as `(?-u:\B)` in the co

(
        &mut self,
        yes: bool,
    )

Source from the content-addressed store, hash-verified

64 /// the parser to return an error. Namely, a negated ASCII word boundary
65 /// can result in matching positions that aren't valid UTF-8 boundaries.
66 pub fn allow_invalid_utf8(
67 &mut self,
68 yes: bool,
69 ) -> &mut TranslatorBuilder {
70 self.allow_invalid_utf8 = yes;
71 self
72 }
73
74 /// Enable or disable the case insensitive flag (`i`) by default.
75 pub fn case_insensitive(&mut self, yes: bool) -> &mut TranslatorBuilder {

Callers 4

roundtrip_bytesFunction · 0.45
tFunction · 0.45
t_errFunction · 0.45
t_bytesFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected