← All repos

ansi-regex

Regular expression for matching ANSI escape codes

Browse cluster: Terminal & CLI Output Styling
66commits
16contributors
2languages

Tech stack & purpose

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.

Community & reference links

Languages

JavaScript
99.3%
TypeScript
0.7%

Contributors