prefer-regexp-exec Prefer RegExp.exec when regular-expression match details are consumed String.match changes its result shape for global patterns and places matching behavior on the input string. Instead, you SHOULD call RegExp.exec for a non-global pattern when consuming one match record. Global patterns remain with String.match because they collect every match rather than one match record. - Category: style - Level: warning - Fix: automatic - Scope: module Reported function firstMatch(text: string): unknown { return text.match(/[a-z]+/i); } Accepted function firstMatch(text: string): unknown { return /[a-z]+/i.exec(text); } Prior art - typescript-eslint ยท prefer-regexp-exec language/linter/src/rules/style/preferregexpexec.rs:8