Hey all! I'm searching through text data (using regular expressions)
and searching for SMTP error codes. I've commented some code below
to highlight what I'm experiencing. I figure posting the code with
comments would be easier than explaining without the code. Any help
would be HIGHLY appreciated.
Thanks! -Scott
------------------
[This message has been edited by Scott Wolfington (edited September 06, 2000).]
and searching for SMTP error codes. I've commented some code below
to highlight what I'm experiencing. I figure posting the code with
comments would be easier than explaining without the code. Any help
would be HIGHLY appreciated.
Thanks! -Scott
Code:
$COMPILE EXE FUNCTION PBMAIN() AS LONG LOCAL strMessage AS STRING LOCAL a AS STRING LOCAL b AS STRING 'NOTE: This a$ does not work. Note position of - symbol. 'I'm assuming this doesn't work because it's being interpreted 'as a range between the _ and ~. 'a$ = "[a-z0-9._-~][email protected][a-z0-9._-~]+" 'NOTE: How come this doesn't work? I'm escaping the - symbol. 'Is it okay to escape characters within a character class? Seems 'like it *should* work. 'a$ = "[a-z0-9._\-~][email protected][a-z0-9._\-~]+" 'NOTE: Moved the minus sign to the end of each character class 'and everything seems to work fine. a$ = "[a-z0-9._~-][email protected][a-z0-9._~-]+" 'NOTE: Do I need to escape the . in a character class? Doesn't 'seem to make a difference. 'a$ = "[a-z0-9\._~-][email protected][a-z0-9\._~-]+" b$ = "550 5\.1\.1 <" & a$ & "> is NOT a valid mailbox" strMessage$ = "Diagnostic-Code: smtp;550 5.1.1 <[email protected]> is not a valid mailbox" REGEXPR b$ IN strMessage$ TO lPosition&, llength& MSGBOX STR$(lPosition&) & ":" & strMessage$ END FUNCTION
[This message has been edited by Scott Wolfington (edited September 06, 2000).]
Comment