Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
r"
CRITICAL - Unexpected Error: blah blah error(?:(?!pythonerror.Error: blah blah error).)*(?:\b([^\s]+)\npythonerror\.Error: blah blah error)
"
gs
Input 1
1
New
CRITICAL - Unexpected Error: blah blah error Traceback (most recent call last): File "example1.py", line 100, in method1 File "example2.py", line 200, in method2 File "example3.py", line 300, in method3 pythonerror.Error: blah blah error CRITICAL - Unexpected Error: blah blah error Traceback (most recent call last): File "example1.py", line 100, in method1 File "example3.py", line 300, in method3 File "example2.py", line 200, in method2 pythonerror.Error: blah blah error CRITICAL - Unexpected Error: other error Traceback (most recent call last): File "example1.py", line 100, in method1 File "example2.py", line 200, in method2 File "example3.py", line 300, in method3 pythonerror.Error: other error CRITICAL - Unexpected Error: blah blah error Traceback (most recent call last): File "example1.py", line 100, in method1 File "example2.py", line 200, in method2 File "example3.py", line 300, in method3 pythonerror.Error: blah blah error
Substitution