Hi there!
On 14 Dec 99, at 1:05, Thomas Fernandez wrote
about "Re: Solution to %DATE and %TIME macro...":
> AM> THE FINAL RESULT:
>
> AM>
>%SETPATTREGEXP="(?m-s)Date\:\s*?((.*?[\d]{4})\s*?([\d]{0,2}\:[\d]{0,2}\:[\d]{0,2})\s*?(.*))"%REGEXPMATCH="%HEADERS"
>
> Wow. I haven't understood a word <g>, but I can copy and paste this.
> However, this cries for user-definable marcroes (or variables), as
> stated in a recent thread.
That was me who cried about it "in the recent thread", and
NOW you all are able to see why... It was like that: I played a
bit with these regexps, then Allie suggested to make this "little"
macro, at which point it became obvious to me that we
desperately need the user-definable macros...
BTW, I just glanced through Allie's message and found, that he
had omitted a bit of info... There exists another possibility of
using the suggested regular expression. That is, leave the
%SETPATTREGEXP macro as stated above, then erase the
%REGEXPMATCH; instead, write the following in your template:
%REGEXPBLINDMATCH="%HEADERS"
subpattern0: %SUBPATT="0"
subpattern1: %SUBPATT="1"
subpattern2: %SUBPATT="2"
subpattern3: %SUBPATT="3"
subpattern4: %SUBPATT="4"
(for the clarification of what it does, please look through the
help file: I don't feel like describing it here:-)))
The output from this (when the template is used) looks like:
subpattern0: Date: Tue, 9 Mar 1999 10:42:14 +1000
subpattern1: Tue, 9 Mar 1999 10:42:14 +1000
subpattern2: Tue, 9 Mar 1999
subpattern3: 10:42:14
subpattern4: +1000
(I used an elderly message from my own archives for this
example).
So in your template you are now able to write something like:
On %SUBPATT="2", when it was %SUBPATT="3" on your
local clock -- and you live in timezone GMT%SUBPATT="4" ---
you wrote me:
Which would result in the following string inserted into your
message:
On Tue, 9 Mar 1999, when it was 10:42:14 on your local clock -
- and you live in timezone GMT+1000 -- you wrote me:
Isn't it cool???
That's (believe it or not) the power of regular expressions! And
TB, of course:-)
--
SY, Alex
(St.Petersburg, Russia)
http://mph.phys.spbu.ru/~akiselev
---
Thought for the day:
The idea is to die young as late as possible.
---
PGP public keys on keyservers:
0xA2194BF9 (RSA); 0x214135A2 (DH/DSS)
fingerprints:
F222 4AEF EC9F 5FA6 7515 910A 2429 9CB1 (RSA)
A677 81C9 48CF 16D1 B589 9D33 E7D5 675F 2141 35A2 (DH/DSS)
---
--
--------------------------------------------------------------
View the TBUDL archive at http://tbudl.thebat.dutaint.com
To send a message to the list moderation team double click here:
<mailto:[EMAIL PROTECTED]>
To Unsubscribe from TBUDL, double click here and send the message:
<mailto:[EMAIL PROTECTED]>
--------------------------------------------------------------