# E4183

Compiler diagnostic name: `regex_interpolation_is_not_supported`.

Regex interpolation is not supported in `lexmatch` patterns.

`lexmatch` patterns are compiled as part of the match. They must be known as
literal regex patterns instead of being built with string or regex
interpolation.

## Erroneous example

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

The regex pattern tries to interpolate `part`.

## Suggestion

Use a literal pattern in the `lexmatch` case. For dynamic regex matching, build a
regex value and use a regex match expression instead of `lexmatch`.

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