Const
Complex regular expression for matching ANSI escape sequences.
For a simpler regex, see SIMPLE_REGEX.
This regex provides extensive coverage of ANSI escape sequences including:
ESC[
ESC]
ESC P
Use cases:
Performance: Slower due to complex pattern matching Coverage: ~95%+ of all ANSI escape sequences
SIMPLE_REGEX
const terminalOutput = "\x1b[38;2;255;0;0mRed text\x1b]0;Window Title\x07";const sequences = terminalOutput.match(COMPREHENSIVE_REGEX);// Matches: ["\x1b[38;2;255;0;0m", "\x1b]0;Window Title\x07"] Copy
const terminalOutput = "\x1b[38;2;255;0;0mRed text\x1b]0;Window Title\x07";const sequences = terminalOutput.match(COMPREHENSIVE_REGEX);// Matches: ["\x1b[38;2;255;0;0m", "\x1b]0;Window Title\x07"]
Complex regular expression for matching ANSI escape sequences.
For a simpler regex, see SIMPLE_REGEX.
This regex provides extensive coverage of ANSI escape sequences including:
ESC[
ESC]
ESC P
Use cases:
Performance: Slower due to complex pattern matching Coverage: ~95%+ of all ANSI escape sequences