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
/
[\]a-zA-Z0-9]\[([^\.\]]+)\]([\[a-zA-Z0-9])?
/
gi
Input 1
1
New
should pass $test[2] $test.var2[4] $test[0].var3.var4 $test[30].var5[30][3333].var6 $test[0].var7[3][4] $test[0].var8.var9.var10 below should not pass $test.var1 $test.var1.asd test[] test [0] test/[0] test/[0]/ test.[0]
Substitution
should pass $test[2] $test.var2[4] $test[0].var3.var4 $test[30].var5[30][3333].var6 $test[0].var7[3][4] $test[0].var8.var9.var10 below should not pass $test.var1 $test.var1.asd test[] test [0] test/[0] test/[0]/ test.[0]