Regular expression for matching ANSI escape codes
Browse cluster: Terminal & CLI Output Styling →ansi-regex is a JavaScript library that provides a regular expression for matching ANSI escape codes in strings. Built as an npm package and written in JavaScript, it offers an `ansiRegex()` function that returns a regex pattern capable of detecting both standard ECMA 48 codes and various non-standard manufacturer-specific codes, with an optional `onlyFirst` parameter to match only the first occurrence. The project is maintained by Sindre Sorhus and Josh Junon.