Assuming the date is always in the format: [MM]-[DD]-[YYYY].
re.search("([0-9]{2}\-[0-9]{2}\-[0-9]{4})", fileName)
More Related Contents:
- Regular expression doesn't produce expected result
- How t extract last part of a text in python [duplicate]
- re.findall behaves weird
- Do regular expressions from the re module support word boundaries (\b)?
- Split a string by spaces — preserving quoted substrings — in Python
- Does “\d” in regex mean a digit?
- How to filter rows in pandas by regex
- Use Python’s string.replace vs re.sub
- Python regular expression re.match, why this code does not work? [duplicate]
- matching any character including newlines in a Python regex subexpression, not globally
- Python, remove all non-alphabet chars from string
- Python Regex to find a string in double quotes within a string
- How do I return a string from a regex match in python? [duplicate]
- Passing a function to re.sub in Python
- Splitting a string with repeated characters into a list
- Python regex, matching pattern over multiple lines.. why isn’t this working?
- BeautifulSoup returns empty list when searching by compound class names
- What does the “r” in pythons re.compile(r’ pattern flags’) mean?
- Python regex to match dates
- regexes: How to access multiple matches of a group? [duplicate]
- Do Python regular expressions have an equivalent to Ruby’s atomic grouping?
- Finding words after keyword in python [duplicate]
- Grep and Python
- Regexp to remove specific number of occurrences of character only
- re.search() only matches the first occurrence
- How to use str.contains() with multiple expressions in pandas dataframes
- match dates using python regular expressions
- How to Fix JSON Key Values without double-quotes?
- python regular expression across multiple lines
- How to use regex with optional characters in python?