Regular Expressions 101

Search and replace for %keyword% formats

0

Regular Expression
PCRE (PHP <7.3)

/
(\%(\w+(-|_)?(\w+)?)\%)+
/
g

Description

Allows you to do a regex for all keywords starting and ending with a % sign, including ones with dashes or underscores.

Submitted by anonymous - 7 years ago