I am trying to match text then any number using python re regular expression except when the text is certain words. e.g.
# import re
import re
# this match expression is intended to match any alphanumerical word followed by any number unless the first alphanumerical word ends with either germany or france.
match = r'[a-zA-Z0-9]{1,}[\s]{1,}(?<!france)(?<!germany)[0-9]{1,}'
re.findall( match, 'alphanumerical1234text 12312442')
>>>['alphanumerical1234text 12312442'] # this is correct
re.findall( match, 'alphanumerical1234text germany 12312442')
>>> ['germany 12312442'] # this shouldn't return anything
re.findall( match, 'alphanumerical1234textgermany 12312442')
>>>['alphanumerical1234textgermany 12312442'] # this shouldn't return anything
re.findall( match, 'alphanumerical1234text france 12312442')
>>>['france 12312442'] # this shouldn't return anything
re.findall( match, 'alphanumerical1234textfrance 12312442')
>>>['alphanumerical1234textfrance 12312442'] # this shouldn't return anything
any idea how to build this regular expression?