I want to match null or space as optional from the start of the line. The line is as follow:
Date Description Amount
null 12/05/2016 Asian Paints 2,150.65
13/05/2016 Nerolac GEB 5.86 22,512.65 Cr
14/05/2016 Hydra 12,412
The regex that I used is :
regex_null = re.compile(r"^(?:null)?\s+(\d{2}/\d{2}/\d{4})\s+(.*?)\s+(\d[\d,]*\.\d{2}\s+(?:Cr)?)$", re.M)
And what I got is:
null 12/05/2016 Asian Paints 2,150.65
13/05/2016 Nerolac GEB 5.86 22,512.65 Cr
So the null is not optional. It is currently considered compulsory. Can you please help me with this?