Greedy match with negative lookahead in a regular expression
<p>I have a regular expression in which I'm trying to extract every group of letters that is not immediately followed by a "(" symbol. For example, the following regular expression operates on a mathematical formula that includes variable names (x, y, and z) and function names (movav and movsum), both of which are composed entirely of letters but where only the function names are followed by an "(". </p>

<pre><code>re.findall("[a-zA-Z]+(?!\()", "movav(x/2, 2)*movsum(y, 3)*z")
</code></pre>

<p>I would like the expression to return the array</p>

<pre><code>['x', 'y', 'z']
</code></pre>

<p>but it instead returns the array</p>

<pre><code>['mova', 'x', 'movsu', 'y', 'z']
</code></pre>

<p>I can see in theory why the regular expression would be returning the second result, but is there a way I can modify it to return just the array <code>['x', 'y', 'z']</code>?</p>
