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)
| 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 | /// |