0
text = "March 2 - Liebherr has been awarded the contract to supply the heavy lift crane for DEME's Orion. April - "
x  = re.findall(r'(.* - ?$)', text)

I just need it to get the first "March 2 - ", because i wanna remove the dates from the extracted text. the text may be March 22 or any other "month 2 or 1 digit numbers - " so i need a regex to get them all, but just the first.

ihathout
  • 1
  • 2
  • 1
    "get them all, but just the first". Um... all or first? – Stefan Pochmann Mar 06 '17 at 00:14
  • @StefanPochmann "get them all" > get all months + one or two digit numbers. "but just the first" > the first item that will satisfy the pattern so it should not get March 2 - dasdasdsd - – ihathout Mar 06 '17 at 00:22

0 Answers0