" ( [Field1] + [Field2] ) + ( [Field3] - [Field4] ) "
You can easily use
String.prototype.match() that select specific part of string by regex. Note that the
\w+ matches word characters.
var str = " ( [Field1] + [Field2] ) + ( [Field3] - [Field4] ) "; var result = str.match(/\w+/g); console.log(result);