Hello TBTECH,

  I am not positive that the following can be done, but if any e-mail
program can do I'm sure Thebat is the one. :)

I am going to be receiving an e-mail generated from a form on a web
page that will have the following layout:
-----------------------------------------------------------------
Jim, Jones, 111 Portage Ave, Winnipeg, MB, R0G 2J0, 204-555-4463,
[EMAIL PROTECTED], 4444, Tech-P, Burntwood
-----------------------------------------------------------------
I need to send an e-mail to the e-mail address in the message and it
needs to contain a login name and password. The login name in this
case will be Jones4444 which as you can see combines two of the fields
and the password is 4444.

Is it possible to send this e-mail saying that they have successfully
applied to enter this site and can use Jones4444 as the login name and
4444 as the password.

I'm assuming that if it can be done it will use regex, which I am only
barely familiar with and I will need patient advisors.

Roelof Otten replied with the following suggestion:

%SetPattRegExp='(?is)(.*?),\s(.*?),\s(.*?)\n(.*?),\s(.*?),\s'%-
%RegExpBlindMatch='%Text'%-
%To="%SubPatt='4'"%-
Hello %SubPatt='1',
Your username is %SubPatt='2'%SubPatt='5',
your password is %SubPatt='5'

Note  and apologies to Roelof the dashes above are not included in the
email I receive.

I played with the code a bit and now have it as follows:

%SetPattRegExp='(?is)(.*?),\s(.*?),\s(.*?)\s(.*?),\s(.*?),\s(.*?)\s(.*?),\s(.*?)\s(.*?),\s(.*?),\s'%-
%RegExpBlindMatch='%Text'%-
%To="%SubPatt='9'"%-
Hello %SubPatt='1',
Your username is %SubPatt='2'%SubPatt='10'
Your password is %SubPatt='10'

This  works  for  the  most  part,  but  I'm  a  little  leery  of the
reliability.  The problem is that the email address is the 8th subpatt
not  the  9th  and the password is the 9th not the 10th. If I list all
the subpatts, I get
Jim -1
Jones -2
111 -3
Portage Avenue -4
etc.
As  you  can see the 111 is being picked up as a separate subpatt even
though  it is part of the address and does not have a comma behind it.
Can anyone explain why?

I  am assuming (.*?) matches any string, and the ,\s selects the comma
and the white space. What does the initial (?is) do?

How does it know what subpatt 1,2,3 etc. are and will I always get two
subpatts for the mailing address regardless of what it is?


-- 
 Stuart                          mailto:[EMAIL PROTECTED]

________________________________________________________

http://www.silverstones.com/thebat/TBUDLInfo.html

Reply via email to