title: Python - Read Tokens from a String
body: <p>I am reading all tokens (operators, <code>int</code>, <code>str</code>,  etc.) from a string</p>
  
  <p>My current code:</p>
  
  <pre><code>import re
  expression = "($mat.name == 'sign') AND ($most == 100.0)"
  tokens = re.findall("\$+[a-zA-Z]*\.[a-zA-Z]+|[a-zA-Z]+|Not|not|NOT|[=]+|[+/*()-]|[0-9]*\.[0-9]+|[0-9]+", expression)
  </code></pre>
  
  <p>The current result: </p>
  
  <pre><code>['(', '$mat.name', '==', 'sign', ')', 'AND', '(', 'most', '==', '100.0', ')']
  </code></pre>
  
  <p>The problem is that, while the regex is correctly matching <code>$mat.name</code>, it matches <code>most</code> instead of <code>$most</code>.</p>
  
  <p>Can you please help me fix the regular expression?</p>