blob: 93f162cc4895f30d5448cc03db8f0d7629f3f745 [file] [log] [blame]
Yang Guo4fd355c2019-09-19 10:59:03 +02001'use strict';
2
3module.exports = () => {
4 const pattern = [
Simon Zünd7a585242022-04-19 08:17:13 +02005 '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[a-zA-Z\\d]*)*)?\\u0007)',
Yang Guo4fd355c2019-09-19 10:59:03 +02006 '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'
7 ].join('|');
8
9 return new RegExp(pattern, 'g');
10};