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\s*[\w-]+="[^<>]*>|\s*\/?>)))
/
g
Input 1
New
<html itemscope="" itemtype="http://schema.org/QAPage"><head> <title>php - Increase regex performance when matching only if not in html attribute - Stack Overflow</title> <link rel="shortcut icon" href="//cdn.sstatic.net/Sites/stackoverflow/img/favicon.ico?v=4f32ecc8f43d"> <link rel="apple-touch-icon image_src" href="//cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon.png?v=c78bd457575a"> <link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="/opensearch.xml"> <meta name="twitter:card" content="summary"> <meta name="twitter:domain" content="stackoverflow.com"> <meta property="og:type" content="website"> <meta property="og:image" itemprop="image primaryImageOfPage" content="http://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded&a"> <meta name="twitter:title" property="og:title" itemprop="title name" content="Increase regex performance when matching only if not in html attribu
Substitution
<html itemscope="" itemtype="http://schema.org/QAPage"><head> <title>php - Increase regex performance when matching only if not in html attribute - Stack Overflow</title> <link rel="shortcut icon" href="//cdn.sstatic.net/Sites/stackoverflow/img/favicon.ico?v=4f32ecc8f43d"> <link rel="apple-touch-icon image_src" href="//cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon.png?v=c78bd457575a"> <link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="/opensearch.xml"> <meta name="twitter:card" content="summary"> <meta name="twitter:domain" content="stackoverflow.com"> <meta property="og:type" content="website"> <meta property="og:image" itemprop="image primaryImageOfPage" content="http://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded&a"> <meta name="twitter:title" property="og:title" itemprop="title name" content="Increase regex performance when matching only if not in html attribu