Detect the dates from text in text file. And then list them out using python
Question: I have a text file that contains dates in the text. these dates are of format
("march 2016" or "march 2, 2016"). I wish to list them out. Can anybody help
me with this?

this is my attempt

    
    
    import re 
    regex = '\s(\w+)\s(\d+\,)\s(\d+)' # this will match the form "str int, int" with open('./BACKGROUND OF THE SOLICITATION3.txt', 'r') as f: 
       text = f.read() 
    all_dates = [' '.join(date) for date in re.findall(regex, text)] 
    print all_dates
    


Answer: 
    s = " I want to detect both March 20, 2013 and February 2013 3 and list them"
    
    import  re
    
    print(re.findall(r"([A-Z][a-z\s\d]+, \d+|[A-Z][a-z\s]+\d+)",s))
    ['March 20,2013', 'February 2013']
    

