# E0077

Warning name: `lexmatch_longest_match`

This warning described an earlier experimental form of longest-match
`lexmatch` and is not emitted by the current compiler.

Current `lexmatch ... with longest` is supported for in-memory `String` and
`StringView` inputs when its cases use regex constant expressions.

## Erroneous example

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

## Suggestion

Convert each legacy string pattern to a regex literal. Anchor it at `^`, and at
`$` as well when the case must consume the whole input. Replace a trailing rest
binder with `after=`.

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