Sha256: 110c5fe554eccdda9b95be9a33edd4d4e867c8432460a8f39c9b7ff841b00772

Contents?: true

Size: 350 Bytes

Versions: 112

Compression:

Stored size: 350 Bytes

Contents

export default function ansiRegex({onlyFirst = false} = {}) {
	const pattern = [
	    '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
		'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
	].join('|');

	return new RegExp(pattern, onlyFirst ? undefined : 'g');
}

Version data entries

112 entries across 33 versions & 1 rubygems

Version Path
immosquare-cleaner-0.1.45 node_modules/boxen/node_modules/string-width/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.45 node_modules/wrap-ansi/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.45 node_modules/widest-line/node_modules/string-width/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.45 node_modules/@isaacs/cliui/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.44 node_modules/boxen/node_modules/string-width/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.44 node_modules/wrap-ansi/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.44 node_modules/widest-line/node_modules/string-width/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.44 node_modules/@isaacs/cliui/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.43 node_modules/boxen/node_modules/string-width/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.43 node_modules/wrap-ansi/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.43 node_modules/widest-line/node_modules/string-width/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.43 node_modules/@isaacs/cliui/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.42 node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.42 node_modules/wrap-ansi/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.42 node_modules/widest-line/node_modules/string-width/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.42 node_modules/npm-check-updates/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.42 node_modules/boxen/node_modules/string-width/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.42 node_modules/@isaacs/cliui/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.41 node_modules/@isaacs/cliui/node_modules/strip-ansi/node_modules/ansi-regex/index.js
immosquare-cleaner-0.1.41 node_modules/wrap-ansi/node_modules/strip-ansi/node_modules/ansi-regex/index.js