I have some sentence like
- "Apartment at Chennai has 4 rooms with a swimming pool"
- "this apartment has 2/3 room with a coridor"
How to extract the only number before the word "room|rooms". looking for an answer which must be 4 and 2/3. The code i tried,
room_found =re.findall(r"\d\s?\/?\d?\s?(?=(rooms)|(room))", str_arg)
print(room_found)
This prints [('', '4 room')] and [('', '2/3 room')], but i am expecting only 4 and 2/3 to be printed.