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
/
\G(\(\d+\))\s+((?:[^\(]|\((?!\d+\)))*[^\(\s])(?:\s+|$)
/
gm
Input 1
1
New
(1) first thing (2) other thing (that,has,details) (3) third thing: stuff (some details), first thing (1) first thing (2) other thing (that,has,details) (3) third thing: stuff (some details), first thing (4) potentially (5) more (6) things (7) too
Substitution
(1) first thing (2) other thing (that,has,details) (3) third thing: stuff (some details), first thing (1) first thing (2) other thing (that,has,details) (3) third thing: stuff (some details), first thing (4) potentially (5) more (6) things (7) too