Regular Expressions 101

Isolate Javascript variable name

Open Workspace
  • PCRE (Legacy)
  • Substitution
1

Regular Expression

/
(^var)|(\=(.*))|( )
/
g

Description

Used to isolate the variable name of a JavaScript variable. Works event if there aren't spaces between the variable and the equals sign.

Submitted by Keith Mitchell