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
/
^(\w+) =.*\n(?=((?!\b\1\b)[^!])*(^\1 =|\Z))
/
gm
Test String
New
a = 10 a * 3 foo = 8 2 - 1 b = 18 c = 10 d = 8 d = 4 cd = 72 d / 6 d + 1 e = 1 e = 2 e + 1 FooBar1 = 0 Fuz__ = 8 Fuz__ / 1 f = 1 f + 1 f = 2 f + 1 g = 1 1 / 5 * 8 + 4
Substitution
Processing...