Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
{.+|(?<=var)\s+([^\s]+)\s*=\s*['"]([^'"]+?)['"];
/
gs

Description

grabs the name and value of any js variables that come before brackets

Submitted by warnock - 9 years ago