# regexp/prefer-regexp-exec

enforce that RegExp#exec is used instead of String#match if no global flag is provided

RegExp#exec is faster than String#match and both work the same when not using the /g flag.

# 📖 Rule Details

This rule is aimed at enforcing the more performant way of applying regular expressions on strings.

This rule inspired by @typescript-eslint/prefer-regexp-exec rule (opens new window).

Now loading...

# 🔧 Options

Nothing.

# 📚 Further reading

# 🚀 Version

This rule was introduced in eslint-plugin-regexp v0.3.0

# 🔍 Implementation

Last Updated: 6/25/2022, 12:32:38 PM