I have this kind of results:
ª!è[008:58:049]HTTP_CLI:0 - Line written in...
HTTP_CLI:0 - Line written in...
If you want to get everything after the closing square bracket, no matter what, and skip everything before that you can go with a
match like this:
s = "ª!è[008:58:049]HTTP_CLI:0 - Line written in..." m = re.match(r'^.*?]([\S\s]*)', s) print(m.group(1))
'HTTP_CLI:0 - Line written in...'
This expression looks through an arbitrary number of characters before the closing bracket and matches everything after that. The matched group is available with