I was thinking of fetching all possibly strings that do that, and put them into a hash or txt file then read from file and parse as will..
Example...
Exactly 2w 5d is when I last seen nick.
I seen nick 2w 5d ago.
Nick was seen 2w 5d ago.
This would give me 3 options to go about. But then again it might defeat the purpose of your w m d rules.