Found best regular expression (so far) for inline math

New regex found successfully all my tests, as long as you keep no
spaces between dollar sign:

* this is an equation:     $E=mc^2$
* this is NOT an equation: $ E=mc^2$, $ E=mc^2 $, $E=mc^2 $, ...