RegEx not match if matched in previous group : I have some HTML pages and I want to match some pattern but not in comment.
So let's say i have for example following part of page:

    <div>
    	<div>Hello $world$</div>
    	<div>Another text <!-- $example$--></div>	
    </div>
    <div>
    	How are $you$?
    </div>
    <!-- 
    <div>
    	Lorem ipsum $dolor$ sit
    </div>
    -->
And I need to match $world$ and $you$ but not match $example$ and $dolor$.
I tried do it on my own but i was able to match only all of them or none of them.
Do you have any ideas?

Unfortunately I cannot first delete all comments and then match what is needed, because finally I have to save my results and comments should still be there.