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
r"
(?=(?P<section>Sections?\W+(\w+)(\(\w+\))?(, (\w+)(\(\w+\))?)*))(?P=section)(?! of)
"
g
Input 1
1
New
1) Section 23 2) Section 45(3) 3) point (e) of Section 75 4) Sections 21(1), 54(2), 78(1) 5) Section 45 of JKL 6) Sections 21(1), 54(2), 78(1) of Harry Potter
Substitution
1) Section 23 2) Section 45(3) 3) point (e) of Section 75 4) Sections 21(1), 54(2), 78(1) 5) Section 45 of JKL 6) Sections 21(1), 54(2), 78(1) of Harry Potter