JavaScript Regex that matches words starting with a dot, that do not end with a (. : <p>I am trying to write a regex that matches JavaScript properties only, for a highlight plugin.</p>

<ol>
<li>It should start with a dot but not include it </li>
<li>It should match any word that contains: [_$A-z]</li>
<li>The word cannot end with (</li>
</ol>

<p>so from:</p>

<pre><code>element.classList.add(animationClass);
</code></pre>

<p>it matches only</p>

<pre><code>classList
</code></pre>

<p>and from:</p>

<pre><code>element.classList.anotherProperty = '';
</code></pre>

<p>it matches</p>

<pre><code>classList and anotherProperty
</code></pre>
