mirror of https://github.com/pwndbg/pwndbg.git
Add strip_colors as lib/strings API (#2164)
* Add strip_colors as lib/strings API * Update strings.py --------- Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>pull/2172/head
parent
5d083d471c
commit
676ff74484
@ -0,0 +1,8 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
|
def strip_colors(text):
|
||||||
|
"""Remove all ANSI color codes from the text"""
|
||||||
|
return re.sub(r"\x1b[^m]*m", "", text)
|
||||||
Loading…
Reference in new issue