Regular Expressions 101

Community Patterns

Get HTML DIV content

-2

Regular Expression
PCRE (PHP <7.3)

/
<div[^<>]*>([\s\S]*?)<\/div>
/

Description

Get the content of a DIV HTML Tag.

Submitted by Ivan Milazzotti - 9 years ago