Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

Description

For every occurrence of the char #, match the previous character and save it in a group (backreference).

Example: for the text "a#bc# -#", set backreferences with a, c and -.

You are not allowed to consume the hash character.

Submitted by anonymous - 7 hours ago