With regex,
In [1]: import re
In [2]: regex = re.compile('([\s \S]*) for ([\s \S]*)')
In [3]: str='4 for 9'
In [4]: regex.match(str).groups()
Out[1]: ('4', '9')
In [5]: regex.match("44 for 54").groups()
Out[2]: ('44', '54')
In [6]: regex.match("44 advg for 54 2243").groups()
Out[3]: ('44 advg', '54 2243')
If you put a pattern in (), the regex will consider it as a group. So after a match is found, you can look at the various groups in the match using the groups() method.
It returns a tuple of size equal to the number of groups you defined in your regex.
I am matchin on \s \S on either side of for. This will match anything (all non space and space characters).
If you want onyl numbers, limit the regex to \d+ instead.