deq-shapes 1.0.0

Deq: traditional Kurdish tattoo shapes as an open, parametric design system.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! Compiled regular expressions for constant patterns.

use regex::Regex;

/// Matches nothing.
const NOTHING: &str = r"[^\s\S]";

/// Compile a constant pattern. Every pattern in the crate is valid and exercised by tests; an
/// invalid one would match nothing instead of panicking.
pub(crate) fn compile(pattern: &str) -> Regex {
    Regex::new(pattern).unwrap_or_else(|_| compile(NOTHING))
}