Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(\\begin{(.+atrix|.*rray|.*abular)}[^\\]*)( )*\v(\X*\\end{\g2})
/
gm
Unit Tests
\begin{pNiceArray}
1
&
2
&
3\\
4
&
5
&
6…
→ regex does match
\begin{pNiceArray}
1
&
2
&
3\\
4
&
5
&
6…
→ regex does not match
1
&
2
&
3\\
4
&
5
&
6
→ regex does not match
\begin{matrix}
1
&
2
&
3\\
4
&
5
&
6
\en…
→ regex does match