Ignacio's answer is probably the best way to handle it, but if you aren't using Python 2.6, you can build a function that does things a little more simply without having to rely on regular expressions. Here is a simple and not very robust version I threw together:

This obviously isn't perfect, because it will still accept input like '2 1/2 1/2', which it would evaluate as 3, since it essentially sums up a space delimited list of numbers while evaluating each as a fraction as necessary.

if you do stick with the regular expression based solution, you should know that you can use a raw string to avoid having to double backslash everything. Essentially, you can write:

mixednum = re.compile(r"(\d+) (\d+)/(\d+)")

The r in front of the string tells Python to not evaluate special characters within the string, so you can write literal backslashes and they will be treated as such. Also note that you do not need to escape the slash since it is not a special character in Python regular expressions (because it is not used to mark the borders of the literal regexp like in many languages). the re.IGNORECASE flag also doesn't make a lot of sense here, since it only includes numeric entities in the regexp, and re.DOTALL is also meaningless, since you have no dots for it to apply to.