pub fn matches_pattern(pattern: &str, text: &str) -> boolExpand description
Apply a pattern rule to one value.
A pattern starting with shape: names a built-in structural check;
<date-picker> and <time-picker> compile to inputs carrying one.
Any other pattern is the literal-substring rule.
| Pattern | Shape | Ranges |
|---|---|---|
shape:date | YYYY-MM-DD | month 01-12, day 01-31 |
shape:time | HH:MM | hour 00-23, minute 00-59 |
Both are shape checks, not calendar checks: 2026-02-31 passes.
Surrounding whitespace is trimmed first. An unknown shape: name
never matches, so a typo fails loudly instead of silently accepting
everything.