I want to extract data from 500+ files which look like that:
1. Site Identification of the GNSS Monument
Site Name : Aeroport du Raizet -LES ABYMES - Météo France
Four Character ID : ABMF
Monument Inscription : NONE
IERS DOMES Number : 97103M001
CDP Number : NONE
Monument Description : INOX TRIANGULAR PLATE ON TOP OF METALLIC PILAR
Height of the Monument : 2.0 m
Monument Foundation : ROOF
Foundation Depth : 4.0 m
Marker Description : TOP AND CENTRE OF THE TRIANGULAR PLATE
Date Installed : 2008-07-15T00:00Z
And I'm looking for Date Installed
which comes in two different formats: CCYY-MM-DDThh:mmZ
or CCYY-MM-DD
. Right now I'm using pattern like this: date_installed = re.findall("Date Installed\s*:\s*(.*?)T.*$", contents, re.MULTILINE)
but this only gets dates in CCYY-MM-DDThh:mmZ
.
How can I modify my regex to extract both date formats without using |
operator?