Fix regex for expressions

Previously \S was used which means any character except white-spaces. This means that also single quote characters were selected, as for example in the case `name = 'test)'. Changed the regexp to also exclude the single quote character.