Formmail regex question

by Charlotte Gardner <vgardner(at)>

 Date:  Fri, 25 Feb 2000 08:39:20 -0500
 To:  hwg-languages(at)
  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 

  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 = "" , 
would it match the second regex?

Thanks in advance,

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA