Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2015-11-10 12:30
Flavor·PCRE (Legacy)

/
\{\{[A-Za-z0-9_]+\}\}
/
g
Open regex in editor

Description

Grab all placeholder "tags" that are alphanumeric with optional underscores. In this example my placeholders are double curly braces e.g. {{MY_VARIABLE_NAME}}.

Change out the braces for whichever symbol/character you are using or add/remove more.

E.g. [[MY_VARIABLE_NAME]] would be matched with [[[A-Za-z0-9_]+]]

Submitted by John Cogan