I am new to trying to capture subpatterns using regex. I am using TB!
to create logs of e-mails Hamster has killed for me. Hamster does not
create logs, but rather creates individual e-mails for each killed
message. I am using TB! to extract info from the Hamster-generated
mails; each Hamster-generated mail contains the killed mail's headers
in its text body.
Here's an example regex:
^subject:\s(\*\*\*\sGMX\sSpamverdacht\s\*\*\*\s)?(.*?)$
11111111111111111111111111111111111 222
I want to capture subpattern 2, which is the original subject; I do
not want to capture the string "*** GMX Spamverdacht ***" which GMX
may or may not have prepended to the original subject.
I thought that %REGEXPTEXT captured the highest numbered subpattern,
in this case 2, but it seems to be capturing subpattern 1.
I have read the help, and looked through Gerd Ewald's regex tutorial
again, but I'm afraid my head is spinning a bit. From playing with
things, ISTM that %REGEXPTEXT will return subpattern 0 if that is the
only one matched, and will return subpattern 1 if more than one
subpattern is matched. Do I have this right now? And if I want to
capture a subpattern other than 0 or 1 I will have to use
%SETPATTREGEXP, %REGEXPBLINDMATCH, and %SUBPATT ?
--
Mike
TB! v1.62r
Hamster Classic v1.3.23.4
Windows XP 5.1.2600 Service Pack 1
________________________________________________
Current version is 2.00.6 | "Using TBUDL" information:
http://www.silverstones.com/thebat/TBUDLInfo.html