-1

I have a set of strings which contain dates which can be in following format and I want to extract it using regex in Python

5/12/2016  
05/25/15
9/1/2016
05-18-2019
Feb 26,15
Apr 01,2018
Feb18'19
15-Jun-2018
Aug19'17
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Sarfraj Ansari
  • 119
  • 2
  • 11

1 Answers1

0

I can do each of them individually but I don't know how to join them

You can put each of your regular expressions into its own capture group, and "or" them:

(regex1)|(regex2)|(regex3)

This will match against any string that satisfies at least one of your regular expressions.

Anis R.
  • 6,656
  • 2
  • 15
  • 37