# `ExGram.Router.Filters.Regex`
[🔗](https://github.com/rockneurotiko/ex_gram_router/blob/v0.1.0/lib/ex_gram/router/filters/regex.ex#L1)

Built-in filter that matches text messages against a compiled regex.

This is similar to `ExGram.Router.Filters.Text` with a regex option, but
is the underlying filter used when ExGram dispatches a `:regex` update
(i.e., when the bot module has declared a `regex/2` pattern and ExGram
recognizes the text as matching it).

## Usage

    # Match a named regex update (declared via ExGram.Bot's regex/2 macro)
    filter ExGram.Router.Filters.Regex, :email

    # Match any regex update
    filter ExGram.Router.Filters.Regex

## Options

- `nil` — matches any `:regex` update
- `atom` — matches if the regex name equals the given atom

---

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