Regular Expressions 101

Community Patterns

123...6

selecting a tag and the text inside it

0

Regular Expression
ECMAScript (JavaScript)

/
(?:<(p)([\s\w='":;]+)?>)(.*)(?:<\/(p)>)
/
g

Description

The regular expression separates the beginning and end of the tag, as well as everything between them into separate groups.

Submitted by anonymous - 2 years ago (Last modified 2 years ago)