Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Regular
Expressions
101
Regular
Expressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
^[a-z]*|(?<=q\[)\d*(?=\])
/
gm
Test String
New
h q[0]; h q[1]; h q[2]; h q[3]; cx q[1],q[2]; t q[1]; t q[2]; cx q[0],q[1]; cx q[2],q[3]; t q[0]; y q[1]; x q[2]; t q[3]; cx q[2],q[1]; t q[2]; x q[1]; cx q[0],q[1]; measure q[0] -> c[0]; measure q[3] -> c[3]; measure q[2] -> c[2]; measure q[1] -> c[1];
Extraction
Processing...