Regular Expressions 101

Community Patterns

1...34567...901

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
((<(.|\n)+?>)?[^=])
/
g

Description

The pattern should match only the "=" symbols with in the html content other than the HTML attributes.

i.e if we have <html><head>Sample head</head><body style="Font family: Courier New"><p> This is a test a=b=c=d or a = b = c </p>

</body></html>

The pattern should match only "=" outside the html tags <>

Submitted by Dilip - 10 years ago