I have this series of files that I need to extract a certain number from. The files are formatted as
(Customer Name)(dash)(Branch)(space)(date in MMDDYYYY format).
I need to extract the date in MMDDYYYY format and to date parse it. I did a substring to get the last digits before, but some files will have a “-” in the end, so I am thinking of using regex this time. The problem is, some files aren’t formatted as MMDDYYYY but MDDYYYY. In short, the client sometimes forgets to add a “0” for the month. I can get the the last 8 digits by using this\b\d{8}
but I am hoping to see if it is possible to get from 7 to 8 digits.