-2

i have string which include a lot of dates:

"30Abr2022(fri) 7Mar2022(sat) 4Mar2022(sun)"

what to do to let my output be like that:

"30Abr2022 7Mar2022 4Mar2022 "

without the names of the days...

1 Answers1

-1

import re s = "30Abr2022(fri) 7Mar2022(sat) 4Mar2022(sun)"

print(re.sub("[([].*?[)]]", "", s))

#output: '30Abr2022 7Mar2022 4Mar2022'

vignesh_dv
  • 1
  • 1
  • 2