Could not find the right regex pattern
<p>I want to write a regular expression to match every word which :</p>

<ul>
<li>Does not start with any of these 2 strings (TEMP_, TMP_)</li>
<li>Contains in the middle the string : LME999</li>
<li>Does not end with any of these 2 strings (.flag, _TEMP)</li>
<li>Before and After LME999, the string can have any alphanumeric character</li>
</ul>

<p>I wrote this regular expression, but it does not work as expected</p>

<pre><code>(?!TEMP_)+(?!TMP_)+(\w)+LME999+(\w)+((?!.flag)(?!_TEMP))
</code></pre>

<p>Here are some valid string: 
StringLME999String</p>