Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/RustPython/RustPython
/ stripcolor
Function
stripcolor
Lib/_pyrepl/completing_reader.py:54–55 ·
view source on GitHub ↗
(s: str)
Source
from the content-addressed store, hash-verified
52
STRIPCOLOR_REGEX = re.compile(r
"\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[m|K]"
)
53
54
def
stripcolor(s: str) -> str:
55
return
STRIPCOLOR_REGEX.sub(
''
, s)
56
57
58
def
real_len(s: str) -> int:
Callers
2
real_len
Function · 0.85
left_align
Function · 0.85
Calls
1
sub
Method · 0.45
Tested by
no test coverage detected