fork download
  1. import re
  2. regex = r"(\d[. \d\t]*)(?:pkg\b|k\b|lac\.|lakh\.|crore\.|cr\.|l\b)|\b(?:rent|rs)\.\s*(\d[. \d\t]*)"
  3. test_str = "long upstairs & blocks of bungalows. title: deed of conveyance price: 600m asking contact now \n exclusive list of 3bhk's price 7 crores on sale at bandra / khar naman residency @ bkc 1867 sqft carpet approx. rs. 13 crs rustomjee oriana @ bandra east 1516 sqft with 15 lakh carpet approx. rs. 8.75 cr corner view @ 15th road, bandra 3.5bhk 1265 sqft carpet approx. rs. 8.5 cr neera @ 15th road, bandra 1266 sqft carpet approx. rs. 6.25 cr bldg at pali hill, bandra 1550+ 660 sqft , rent 78k wrap around "
  4. print(["{}{}".format(x,y).strip() for x, y in re.findall(regex, test_str)])
Success #stdin #stdout 0.04s 9592KB
stdin
Standard input is empty
stdout
['13', '8.75', '8.5', '6.25', '78']