Question: I need help in this python program. please help!!! I have the regex for part one: (-?d+)s*/s*(d+) *([+*/-])s*(-?d+)s*/(d+) but now i need help in part
I need help in this python program. please help!!!
I have the regex for part one: (-?\d+)\s*\/\s*(\d+) *([+*\/-])\s*(-?\d+)\s*\/(\d+)
but now i need help in part 2.

![regex for part one: (-?\d+)\s*\/\s*(\d+) *([+*\/-])\s*(-?\d+)\s*\/(\d+) but now i need help in](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66df49bb1b57e_43466df49ba85c03.jpg)
Write a regular expression patt that can be used to extract (numerator,denominator,operator,numerator,denominator) from a string containing a fraction, an arithmetic operator, and a fraction. You may assume there is a space before and after the arithmetic operator and no spaces surrounding the character in a fraction. And all fractions will have a numerator and denominator. Example: >>s 23/45 14/9" >>>re.findal I (patt,s) >>S"-23/45 1419 >>>re.findal I (patt,s) In general, your code should handle any of the operators +, * and I. -, Note: the operator module for the two argument function equivalents of the arithmetic (and other) operators Write a regular expression patt that can be used to extract (numerator,denominator,operator,numerator,denominator) from a string containing a fraction, an arithmetic operator, and a fraction. You may assume there is a space before and after the arithmetic operator and no spaces surrounding the character in a fraction. And all fractions will have a numerator and denominator. Example: >>s 23/45 14/9" >>>re.findal I (patt,s) >>S"-23/45 1419 >>>re.findal I (patt,s) In general, your code should handle any of the operators +, * and I. -, Note: the operator module for the two argument function equivalents of the arithmetic (and other) operators
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
