Filtering expression for e-mails with date in their names [SOLVED]

General discussion related to "Everything".
Post Reply
Thy Grand Voidinesss
Posts: 690
Joined: Wed Jun 01, 2022 5:01 pm

Filtering expression for e-mails with date in their names [SOLVED]

Post by Thy Grand Voidinesss »

I need to find all EML files that start with dates in format
YYYYMMDD
. And that is precisely
YYYYMMDD
and not
YYYY MM DD
or
YY_MM_DD
nor any other variant

I suck at this, so can anyone help me? Filtering out file format will not be a problem, but looking for the right / right amount of digits sure is problematic for me
Last edited by Thy Grand Voidinesss on Thu Jan 04, 2024 10:41 am, edited 1 time in total.
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: Filtering expression for e-mails with date in their names

Post by therube »

Are you looking for a regex: ?
As a start, maybe something like: regex:(19|20)\d\d[01][1-9][0-31]\w

(There could be some false "dates" with that.)
Thy Grand Voidinesss
Posts: 690
Joined: Wed Jun 01, 2022 5:01 pm

Re: Filtering expression for e-mails with date in their names

Post by Thy Grand Voidinesss »

Yes, I am looking for a regular expression

The above works, but does not limit itself to the beginning of name- it needs to take into consideration only the first 8 characters
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: Filtering expression for e-mails with date in their names

Post by therube »

Add a ^:
regex:^(19|20)\d\d[01][1-9][0-31]\w
Thy Grand Voidinesss
Posts: 690
Joined: Wed Jun 01, 2022 5:01 pm

Re: Filtering expression for e-mails with date in their names

Post by Thy Grand Voidinesss »

Thank you. It was not perfect. as it did not single out all of the files with very long names / repeating sections with igits, but I managed to pin point them using also other methods


And later on I managed to find also all files starting with the date and time format
YYYY MM DD - HH.MM.SS
using this

Code: Select all

regex:^(\d{4})\s(\d{2})\s(\d{2})\s-\s(\d{2})\.(\d{2})\.(\d{2})
Post Reply