# E0076

Warning name: `lexmatch_first_match`

Using `lexmatch` with first-match semantics is deprecated.

This warning is emitted for `lexmatch` expressions that use the default
first-match strategy, including `lexmatch ... with first`. Prefer regex match
expressions for ordinary regex checks in new code.

## Erroneous example

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

## Suggestion

Rewrite first-match `lexmatch` code with a regex match expression when possible.
If you specifically need lexer-style longest-match behavior, make that explicit
with `lexmatch ... with longest`.

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