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

Method any

regex/regex-syntax/src/hir/mod.rs:596–606  ·  view source on GitHub ↗

Build an HIR expression for `(?s).`. A `(?s).` expression matches any character, including `\n`. To build an expression that matches any character except for `\n`, then use the `dot` method. If `bytes` is `true`, then this assumes characters are limited to a single byte.

(bytes: bool)

Source from the content-addressed store, hash-verified

594 /// If `bytes` is `true`, then this assumes characters are limited to a
595 /// single byte.
596 pub fn any(bytes: bool) -> Hir {
597 if bytes {
598 let mut cls = ClassBytes::empty();
599 cls.push(ClassBytesRange::new(b'\0', b'\xFF'));
600 Hir::class(Class::Bytes(cls))
601 } else {
602 let mut cls = ClassUnicode::empty();
603 cls.push(ClassUnicodeRange::new('\0', '\u{10FFFF}'));
604 Hir::class(Class::Unicode(cls))
605 }
606 }
607
608 /// Return true if and only if this HIR will always match valid UTF-8.
609 ///

Callers 3

concatMethod · 0.80
any_completeMethod · 0.80
contains_emptyMethod · 0.80

Calls 5

classFunction · 0.85
BytesClass · 0.85
UnicodeClass · 0.85
emptyFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected