# E4184

Compiler diagnostic name: `start_rest_binder_is_not_supported_in_longest_match_strategy`.

A leading rest binder is not supported with the longest-match `lexmatch`
strategy.

In `lexmatch ... with longest`, the engine chooses the longest matching case.
Allowing a rest binder before the regex would make that choice ambiguous, so the
start rest binder is rejected.

## Erroneous example

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

The first `_` attempts to bind or skip input before the `"abc"` regex pattern.

## Suggestion

Match the regex at the start of the remaining input, and bind only the suffix
when needed.

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