Regular Expressions 101

Community Patterns

1...56789...591

HTML to Text only

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(<[^>]+>)+
/
img

Description

Removing HTML tags completely and only keeping text between them. USAGE: I used it to sum words to calculate reading time for articles.

Submitted by @navoneel-talukdar - StackOverflow - a year ago