Formmail regex question
by Charlotte Gardner <vgardner(at)mindspring.com>
|
Date: |
Fri, 25 Feb 2000 08:39:20 -0500 |
To: |
hwg-languages(at)hwg.org |
|
todo: View
Thread,
Original
|
|
In Formmail, the HTTP_REFERER variable is checked to see
if it matches any of the domain(s) specified in the @referer array:
if ($ENV{'HTTP_REFERER'} =~ m|https?://([^/]*)$referer|i)
If it does not, it triggers an error. The error routine conducts a second
check:
if ($ENV{'HTTP_REFERER'} =~ m|^https?://([\w\.]+)|i)
My question is, what is the difference between the two regular
expressions? Is the second one more efficient than the first? If so,
why wasn't it used in the first check?
Also, if the HTTP_REFERER = "http://mydept.mydomain.com/index.html" ,
would it match the second regex?
Thanks in advance,
Charlotte
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA