# require-unicode-regexp

Rule `eslint/require-unicode-regexp`. Enforce the use of `u` or `v` flag on regular expressions

- Source: eslint
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 2.6M weekly downloads of presets that enable it
- Trend: +92.2% last quarter
- Rank: #1467 by reach, #277 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `require-unicode-regexp` | no | suggestion | package `eslint` | [docs](https://eslint.org/docs/latest/rules/require-unicode-regexp) |
| Oxlint | `require-unicode-regexp` | no | no | plugin `eslint`, category pedantic | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/require-unicode-regexp.html) |
| Biome | `style/useUnicodeRegex` | no | safe | group style, since 2.4.5 | [docs](https://biomejs.dev/linter/rules/use-unicode-regex/) |

## Code examples

### Incorrect: the rule reports this

```js
const a = /aaa/
const b = /bbb/gi
const c = new RegExp("ccc")
const d = new RegExp("ddd", "gi")
```

### Correct: the rule accepts this

```js
const a = /aaa/u
const b = /bbb/giu
const c = new RegExp("ccc", "u")
const d = new RegExp("ddd", "giu")

const e = /aaa/v
const f = /bbb/giv
const g = new RegExp("ccc", "v")
const h = new RegExp("ddd", "giv")

// This rule ignores RegExp calls if the flags could not be evaluated to a static value.
function i(flags) {
    return new RegExp("eee", flags)
}
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "require-unicode-regexp": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "require-unicode-regexp": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "useUnicodeRegex": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |

## Related rules

- [eslint/complexity](https://lintradar.dev/rules/eslint/complexity.md): Enforce a maximum cyclomatic complexity allowed in a program
- [eslint/max-nested-callbacks](https://lintradar.dev/rules/eslint/max-nested-callbacks.md): Enforce a maximum depth that callbacks can be nested
- [eslint/prefer-object-has-own](https://lintradar.dev/rules/eslint/prefer-object-has-own.md): Disallow use of `Object.prototype.hasOwnProperty.call()` and prefer use of `Object.hasOwn()`
- [eslint/no-object-constructor](https://lintradar.dev/rules/eslint/no-object-constructor.md): Disallow calls to the `Object` constructor without an argument
- [eslint/no-div-regex](https://lintradar.dev/rules/eslint/no-div-regex.md): Disallow equal signs explicitly at the beginning of regular expressions
- [eslint/no-implicit-globals](https://lintradar.dev/rules/eslint/no-implicit-globals.md): Disallow declarations in the global scope

---

Web page: https://lintradar.dev/rules/eslint/require-unicode-regexp. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
