Regular Expressions 101

Community Patterns

capture all li tags from a text

0

Regular Expression
PCRE (PHP <7.3)

/
(\<li\>(?:\n)*(?:.*)(?:\n)*\<\/li\>)
/
gm

Description

this can be used to capture all li items in a text and then wrap them in a ul tag.

Submitted by anonymous - 5 years ago