# no-div-regex

> Disallow regular expressions that start with `=`

A regular expression literal that starts with `=` begins with `/=`, which is also the division assignment operator. You have to look twice to see which one it is.

`--fix` rewrites the `=` to `[=]`, which matches the same text.

{/* Generated by src/codegen/lint-rule-docs.ts. Do not edit this section. */}

## Configure

Off by default. To turn it on:

```toml bunfig.toml
[lint.rules]
"no-div-regex" = "error" # or "warn"
```

{/* End of the generated section. */}

## Examples

Reported:

{/* bad */}
```js
const value = line.replace(/=\s*/, "");
```

Not reported:

{/* good */}
```js
const value = line.replace(/[=]\s*/, "");
```
