Regular Expressions 101

Community Patterns

Locate HTML tags name, attributes

0

Regular Expression
PCRE2 (PHP >=7.3)

/
<(\s)*([a-z0-9]+)(\s)*([a-zA-z0-9%,;()="'?\.\-:_\[\]&{}\/\s]*)(>|(\s)*\/>)*
/
gm

Description

A basic regex formula to find out the HTML tag name and its attributes that are available within HTML tag.

Submitted by anonymous - 2 years ago