I'm learning Python Regex. I'm trying to extract the date strings from the below text.
text= '''CMS Info Systems Pvt. Ltd Ref: CMS/HR/10-11/08/98 30th Aug 2010 Mr. Manohar an P Emp Code Designation DOJ : 46947 : FMS Engineer. : 015' Feb 2008 Chennai Dear Manoharan P, Reg: Acceptance of your Resignation We are in receipt of your resignation letter dated 14h July 2010, tendering your resignation thereof. As requested by you, we have accepted your resignation and you will be relieved of your assignment with us from the close of working hours on 25" Aug 2010'''
So I have written the below regex pattern
matches_text1= re.findall('\d{1,2}[a-z\s\"]*[^0-9a-zA-Z]*((?i)Jan|(?i)Feb|(?i)Mar|(?i)Apr|(?i)May|(?i)Jun|(?i)Jul|(?i)Aug|(?i)Sep|(?i)Oct|(?i)Nov|(?i)Dec|(?i)January|(?i)February|(?i)March|(?i)April|(?i)May|(?i)June|(?i)JULY|(?i)August|(?i)September|(?i)October|(?i)November|(?i)December)[\s]*[^0-9a-zA-Z]*\d{2,4}',text)
When I try the same text in the online regex editor https://regex101.com/ with the above pattern, it highlights the required text. The highlighted text as below 4 dates are correctly shown.
- 30h Aug 2010
- 15' Feb 2008
- 14h July 2010
- 25" Aug 2010
However when I run the same regex pattern code in the python IDE Spyder, I get the output as below [Aug,Feb,July,Aug] ie., only the month text without DD and YYYY texts
Please tell me what I'm missing