The pattern I'd use: ((\d+)(?!.*\d).*)engineer
-- it looks for the latest digit and goes from there.
Something similar to (\d.*)engineer
would also work but only if there's only one digit in the string.
>>> import re
>>> string = '123 abc mysql 23 rufos kanso engineer'
>>> pattern = r'((\d+)(?!.*\d).*)engineer'
>>> re.search(pattern, string).group(1)
'23 rufos kanso '
>>>
Edit
In case there are digits after the 'engineer' part, the pattern mentioned above does not work, as you have pointed out in the comment. I tried to solve it, but honestly I couldn't come up with a new pattern (sorry).
The workaround I could suggest is, assuming 'engineer' is still the 'key' word, splitting your initial string by said word.
Here is the illustration of what I mean:
>>> string = '123 abc mysql 23 rufos kanso engineer 1234 b65 de'
>>> string.split('engineer')
['123 abc mysql 23 rufos kanso ', ' 1234 b65 de']
>>> string.split('engineer')[0]
'123 abc mysql 23 rufos kanso '
# hence, there would be no unexpected digits
>>> s = string.split('engineer')[0]
>>> pattern = r'((\d+)(?!.*\d).*)'
>>> re.search(pattern, s).group(1)
'23 rufos kanso '