Regular Expressions 101

Community Patterns

identify html headers

0

Regular Expression
PCRE (PHP <7.3)

/
(?J)(?<open><(?<tag>h[1-6])>)(?<text>.*)(?<close><\/?(?'tag'h[1-6])>)
/
Umg

Description

Able to identify many header html tags in the text and group eachone.

Submitted by Adão Dias - 2 years ago