I have a div, and this div can (or cannot) have html elements as children. With my javascript, i need to find all the occurrences of a word inside this div, except for those in the `<a>` tag.

For example:

```
<div id="dictionable">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
    <br/><br/>
    <a href="#lorem">lorem</a>
    <br/><br/>
    <p>lorem</p>
</div>

```

I tried with my ultra low capabilities to build a regex, failing miserably.
So I googled and found this:

```
var pattern = new RegExp('(lorem)(?![^<]*>|[^<>]*</)', 'gim');

```

this regex finds every occurrence of "lorem" but not in EVERY tag.
I just need to exclude only the A tag.

Could anyone help me?