Forum

Share

Please consider registering
guest

Log In RegisterMembers
Or log in with

Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Header Regex Match custom search
January 18, 2011
5:33 pm
Bob
Guest

i would like to create a filter based on a header regex match on the date header but it is not working

as expected.  i would like to match based on the hour the message is sent.

i have tried numerous iterations but i can't seem to match a colon in the regex:

date:/:/

the date contain colons in the time portion but even this simple regex does not match.

i have tried backslash escaping the colon but this doesn't work either.

if i change the regex to // (match anything) this does match.

any suggestions?

Share
January 18, 2011
8:52 pm
Admin
Forum Posts: 323
Member Since:
July 12, 2008
Offline

I looked into this. Unfortunately there are three names where the header name is reinterpreted by the base code, so you do not really get the true string value of the header available: Date, Received, and Status. Data in particular is stored as a 64 bit integer, not as a string.

But the value of the Date is available in the header, just not as a string. You can get to it and search on it using a javascript search. So, for example, if you want to find emails that were sent between the hours of 12 and 18, the following javascript search will find them:

 

let sentDate = new Date(message.date/1000);
(sentDate.getHours() >= 12 && sentDate.getHours() < 18)

Share
January 19, 2011
11:09 am
Bob
Guest

rkent said:

I looked into this. Unfortunately there are three names where the header name is reinterpreted by the base code, so you do not really get the true string value of the header available: Date, Received, and Status. Data in particular is stored as a 64 bit integer, not as a string.

But the value of the Date is available in the header, just not as a string. You can get to it and search on it using a javascript search. So, for example, if you want to find emails that were sent between the hours of 12 and 18, the following javascript search will find them:

 

let sentDate = new Date(message.date/1000);

(sentDate.getHours() >= 12 && sentDate.getHours() < 18)


awesome.  thanks for the info.  i will try it out.

Share
Forum Timezone: UTC -8

Most Users Ever Online: 18

Currently Online:
12 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

bobkatz: 8

BigMike: 8

t2m: 7

zabolyx: 7

taa: 6

onlyme: 6

Member Stats:

Guest Posters: 130

Members: 565

Moderators: 1

Admins: 1

Forum Stats:

Groups: 1

Forums: 7

Topics: 231

Posts: 802

Moderators: rkent (323)

Administrators: rkent (323)