Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
~
(?!<[^>]*?>)\bhello world\b(?![^<]*?(?:</[^/]*>|>))
~
g
Input 1
1
New
one two three hello world four five one <a href='index.html'> hello world </a> four five foo bar <p>hello world</p> hello <p name="hello world">hello world</p> one two three <img alt='hello world' \>four five <img alt="hello world"> foo foo bar <a href="index.html">hello world</a> again one two three hello world four five one two three <img alt='hello world' \>four five
Extraction