Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

~
[^<>](?![^<]*>|[^<>]*<\/)(?!\s\#\s)(\#\S[^<>](?![^<]*>|[^<>]*<\/)(.*?)\S\#)
~
mUg

Description

Finds all occurence in a plain text / html text where a text is between 2 hashtags : #text#

Submitted by Kervan Mazuy - a year ago