Regular Expressions 101

Community Patterns

1...45678...877

Reading only the "=" symbol

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