To exclude content within HTML tags a good trick is using 'not followed by' and including angle bracket characters in them. For example your regex ends with this:
(?!.+\>)
Which presumably should mean 'not followed by a one or more characters and a closing angle bracket.'
However that 'one or more characters' is too broad and will be matching more than you want: If you make that a bit stricter then it won't be as greedy:
(?![^<>]*>)
So that's 'not followed by non-angle-brackets and a closing bracket.'
That way it'll only do the replacement if it's OUTSIDE an HTML tag, because if it's inside, then that will match, so the NOT followed by will stop it from replacing.
You may need to include <> in other character classes as well to limit them.
Note that this isn't strictly 100% compliant, in that attributes can legally have those characters in them, however in many cases you know enough about your input that you can safely use [^<>] to simplify the task without causing any issues.
$ python
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> mystring = 'asdd qwe <a href="http://example.com" title="Some title with word qwe" class="external-link" rel="nofollow"> qwe '
>>> import re
>>> p=re.compile(r'([^\s<>]+)(?![^<>]*>)')
>>> p.findall(mystring)
['asdd', 'qwe', 'qwe']
>>>
$
Second test:
$ python
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> mystring = r'words <a href="example.com" title="title with word qwe" class="external-link" rel="nofollow"> qwe some other words'
>>> p=re.compile(r'([^\s<>]+)(?![^<>]*>)')
>>> p.findall(mystring)
['words', 'qwe', 'some', 'other', 'words']
>>> mystring = r'words <a href="example.com" title="title with word qwe" class="external-link" rel="nofollow"> qwe <strong class="bad-word" style="color:red">podmiotu</strong> some other words'
>>> p.findall(mystring)
['words', 'qwe', 'podmiotu', 'some', 'other', 'words']
>>>
Note that 'qwe' is in both strings, outside of an HTML tag, so it SHOULD match I think.
To search for a specific word, just use that in the regex:
Find the word 'some' if it's outside HTML:
>>> p=re.compile(r'(some)(?![^<>]*>)')
>>> p.findall(mystring)
['some']
>>>
Find the word 'external' if it's outside HTML (fails, correctly):
>>> p=re.compile(r'(external)(?![^<>]*>)')
>>> p.findall(mystring)
[]
>>>