Skip to main content

pattern_capture

Function pattern_capture 

Source
pub fn pattern_capture(pattern: &str, value: &str) -> Option<String>
Expand description

Match value against a model PATTERN and return what the wildcard captured.

A pattern is either an exact slug (matches by equality; the capture is the whole value) or a single-* glob (opus*, *[1m], openai/gpt-5*), where * stands for any run of characters including the empty one. A second * is not a pattern this build understands and never matches, so a typo fails closed rather than matching everything.