I have a lot of files that will include names, dates, and titles or locations, and a lot of variations in the delimiters. What I'd like to be able to do is have a regex that can remove all characters NOT between numbers, and then maybe another regex to replace characters ONLY if between numbers.
Examples of removing characters between numbers (for me this will always be dates, but potentially different date formats as below):
John Smith - 2022.07.14.Tampa.Florida.mp4 becomes John Smith - 2022.07.14 Tampa Florida by removing all periods NOT between numeric characters
tracy.johnson.19.06.22.houston.texas becomes tracy johnson 19.06.22 houston texas by removing all periods NOT between numberic characters
chris-moore-2-22-2017-detroit, michigan becomes chris moore 2-22-2017 detroit, michigan by removing all dashes NOT between numeric characters
Then the next step would be to replace characters between numbers with a different character for uniformity, sometimes as a second process after the above regex, sometimes as its own and only process:
John Smith - 2022.07.14 Tampa Florida becomes John Smith - 2022-07-14 Tampa Florida by replacing periods with dashes ONLY if the periods are between numbers
tracy johnson 19.06.22 houston texas becomes tracy johnson 19-06-22 houston texas by replacing periods with dashes ONLY if the periods are between numbers
chris moore - 2-22-2018 - detroit, michigan becomes chris moore - 2.22.2018 - detroit, michigan by replacing dashes with periods ONLY if the dashes are between numbers
jupiter jones 2017 11 13 san jose, california becomes jupiter jones 2017-11-13 san jose, california by replacing spaces with dashes ONLY if the spaces are between numbers
I hope this makes sense. I tried to give different examples so that I can be flexibile with both of the regexes. I need two different ones because when I get the files they don't always have the same issues, and I need to be able to use one or the other, and possibly in different orders of operations to accomplish the final naming schema that I need. Thanks for any help here!