# E4216

Compiler diagnostic name: `lexscan_catchall_binder_not_supported`.

A `lexscan` catch-all case uses a binder pattern.

`lexscan` consumes input only when a regex matches. The final catch-all also
handles end of input, so it does not bind a matched substring. Use `_` for that
case and bind text with `as` on the regex cases that need it. This also applies
when the target is an in-memory `@lexbuf.StringScanner`.

## Erroneous example

```{literalinclude} /sources/error_codes/4216_error/top.mbt
:language: moonbit
```

## Suggestion

Replace the catch-all binder with `_`.

```{literalinclude} /sources/error_codes/4216_fixed/top.mbt
:language: moonbit
```
