Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
((?:\\033|\e|\\x1B|\\x1b){1}(?:\[(?:=|\?|[0-9]*)[0-9]*[a-gA-GnmsuJKhlHL]{0,1}(?:(?:\;[0-9]*)*m){0,1}))
/
g

Description

Use control_sequence_filter group to find and remove ANSI CSI codes. Not tested thoroughly. Only for the task that was necessary for me

Submitted by Leonards Elksnis - 2 years ago (Last modified 2 years ago)