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
/
(?:(?s:START.*?END)|\/\/.*|\.\s*\w+\b)(*SKIP)(*F)|old
/
g
Input 1
__DATA__ xx START xx old xx END xx --> ignore xx old xx --> REPLACE ! START xx old --> ignore xx old xx END --> ignore xx old xx --> REPLACE ! // xx old --> ignore xx // xx old --> ignore xx . old old xx --> ignore first one, replace second one . old --> ignore (old) xx --> REPLACE ! xx old xx --> REPLACE !
Extraction
__DATA__ xx START xx old xx END xx --> ignore xx old xx --> REPLACE ! START xx old --> ignore xx old xx END --> ignore xx old xx --> REPLACE ! // xx old --> ignore xx // xx old --> ignore xx . old old xx --> ignore first one, replace second one . old --> ignore (old) xx --> REPLACE ! xx old xx --> REPLACE !