Regular Expressions 101

Quiz_10_Followed_by_#

Open Workspace
  • PCRE2 (PHP)
  • Substitution
1

Regular Expression

/
(.)(?=#)
/
i

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