# `Nous.Eval.Scorers.Regex`
[🔗](https://github.com/nyo16/nous/blob/v0.21.1/lib/nous/eval/scorers/regex.ex#L1)

Passes when the output text matches regular expressions.

    {Nous.Eval.Scorers.Regex, patterns: ["order #\\d+", "refund"], mode: :all}

## Options

  * `:patterns` - non-empty list of regex sources (required). They are
    compiled once in `init/1`: an invalid pattern is a configuration
    error, never a "not found"
  * `:mode` - `:all` (default) or `:any`
  * `:case_sensitive` - default `true`

`details.unmatched` lists the indexes of the patterns that did not match.
A failed run fails with reason `"run_failed"`; non-text output is an
`:invalid_config` error.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
