Name

email_only — e-mail address is syntactically correct

DESCRIPTION

Verification of the form field value succeeds if it contains a syntactically valid e-mail address.

EXAMPLES

Example: email_only

FORM_FIELD_NAME=email_only

NOTES

AVAILABILITY

email_only is available in Interchange versions:

4.6.0-5.9.0 (git-head)

SOURCE

Interchange 5.9.0:

Source: code/OrderCheck/email_only.oc
Lines: 24


# Copyright 2005-2009 Interchange Development Group and others
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.  See the LICENSE file for details.
# 
# $Id: email_only.oc,v 1.5 2009-01-28 07:38:26 racke Exp $

CodeDef email_only OrderCheck 1
CodeDef email_only Description Email address
CodeDef email_only Routine <<EOR
sub {
my($ref, $var, $val, $msg) = @_;
if($val and $val =~ /^[\040-\053\055-\077\101-\176]+\@[-A-Za-z0-9.]+\.[A-Za-z]+$/) {
  return (1, $var, '');
}
else {
  return (undef, $var,
    $msg || errmsg("'%s' not an email address", $val )
  );
}
}
EOR

AUTHORS

Interchange Development Group

SEE ALSO

DocBook! Interchange!