Python 2.7.1 I am trying to use python regular expression to extract words inside of a pattern
I have some string that looks like this
someline abc s
Here's a way to do it without using groups (Python 3.6 or above):
>>> re.search('2\d\d\d[01]\d[0-3]\d', 'report_20191207.xml')[0] '20191207'