On Oct 25, Jason LaMar said:

>I'm trying to modify the ubiquitous FormMail CGI scripts so that Web form
>results are sent ONLY to recipients on campus. Right now, there's a line to
>accomplish this for [EMAIL PROTECTED] e-mail addresses ...
>
>@validrecipients = ( '^[a-z]{1,}\@cc\.owu\.edu$' );
>
>My question is: What code do I have to add to get Web form results to ALSO
>go to [EMAIL PROTECTED] (without the "cc" on the front end of the domain)?

(You can use + instead of {1,} in the regex -- it's standard practice.)

To do what you want, make the cc\. part optional:

  '^[a-z]+\@(cc\.)?owu\.edu$'

X? means that X is optional (matches zero or one time).  Refer to the
perlre and perlretut documentation, available on your computer via the
'perldoc' program, or online at http://www.perldoc.org/.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to