1 declare namespace ansiRegex {
4 Match only the first ANSI escape.
13 Regular expression for matching ANSI escape codes.
17 import ansiRegex = require('ansi-regex');
19 ansiRegex().test('\u001B[4mcake\u001B[0m');
22 ansiRegex().test('cake');
25 '\u001B[4mcake\u001B[0m'.match(ansiRegex());
26 //=> ['\u001B[4m', '\u001B[0m']
28 '\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
31 '\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
32 //=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
35 declare function ansiRegex(options?: ansiRegex.Options): RegExp;