If you can execute a JavaScript function, you might be able to use this:

--------------------

function not_valid_email_address_string (string) {
//
//
----------------------------------------------------------------------------
---------------------
//
-
//  Review the string primitive provided and verify that it confirms to a
[EMAIL PROTECTED] format and
//  that it uses a valid domain name extension.
//
//  INBOUND:  string = string primitive containing the email address
//
//  OUTBOUND: function result = logical = .true. if there's a problem,
.false. if the email address is OK
//
//  Copyright 2004, ITM3 California.  All rights reserved.  ([EMAIL PROTECTED],
<http://www.itm3.com> http://www.itm3.com)
//  Written May 2004, revision 0.
//
-
//
----------------------------------------------------------------------------
---------------------
//
//alert("entering not_valid_email_address_string with: \"" + string + "\"");
//
  if (empty_string(string)) {
    return true;                                  // return .true. when no
email address is provided
  }
  else if (string.match(/(\w+)\@(\w+)\.(\w{2,})/) == null) {
    return true;                                  // return .true. when not
in the form "[EMAIL PROTECTED]"
  }
  else {
    return false;                                 // return .false. when
everything looks in order
  }
}

--------------------

As in, "if (not_valid_email_address_string(EmailAddress)) { issue warning
}".  (The key regular expression is, "/(\w+)\@(\w+)\.(\w{2,})/".)

You might also want to verify the domain extension:

--------------------

function known_domain_name_extensions () {
//
//
----------------------------------------------------------------------------
---------------------
//
-
//  Return a linklist of known Internet domain name extensions.
//
//  INBOUND:  null
//
//  OUTBOUND: function result = string primitive linklist
//
//  Copyright 2004, ITM3 California.  All rights reserved.  ([EMAIL PROTECTED],
<http://www.itm3.com> http://www.itm3.com)
//  Written May 2004, revision 0.
//
-
//
----------------------------------------------------------------------------
---------------------
//
  var list1 = ".ad  Andorra .ae  United Arab Emirates .af  Afghanistan .ag
Antigua and Barbuda .ai  Anguilla .al  Albania .am  Armenia .an  Antilles
(Netherlands) .ao  Angola .aq  Antarctica .ar  Argentina .arpaAdvanced
Projects Research Agency .at  Austria .au  Australia .aw  Aruba
(Netherlands) .az  Azerbaijan .ba  Bosnia-Hertsegovina .bb  Barbados .bd
Bangladesh .be  Belgium .bf  Burkina Faso .bg  Bulgaria .bh  Bahrain .bi
Burundi .biz Business .bj  Benin .bm  Bermuda .bn  Brunei Darussalam .bo
Bolivia .br  Brazil .bs  Bahamas .bt  Bhutan .bv  Bouvet Island .bw
Botswana .by  Belarus .bz  Belize .ca  Canada .cc  Cocos Keeling Islands .cf
Central African Republic .cg  Congo .ch  Switzerland .cl  Chile .cm
Cameroon .cn  China .co  Colombia .com Commercial .cr  Costa Rica .cs
Czechoslovakia .cu  Cuba .cv  Cape Verde .cx  Christmas Islands .cy  Cyprus
.cz  Czech Republic ";
//
  var list2 = ".de  Germany .dj  Djibouti .dk  Denmark .dm  Dominica .do
Dominican Republic .dz  Algeria .ec  Ecuador .edu  Education .ee  Estonia
.eg  Egypt .eh  Western Sahara .er  Eritrea .es  Spain .et  Etiopia .fi
Finland .fj  Fiji .fk  Falkland Islands .fm  Micronesia .fo  Faroe Islands
(Denmark) .fr  France .fx  France .ga  Gabon .gb  Great Britain .gd  Grenada
.ge  Georgia .gf  French Guiana .gh  Ghana .gi  Gibraltar (UK) .gl
Greenland (Denmark) .gm  Gambia .gn  Guinea .gov Government .gp  Guadeloupe
(France) .gq  Equatorial Guinea .gr  Greece .gs  South-Georgia and South
Sandwich Islands .gt  Guatemala .gu  Guam (US) .gw  Guinea Bissau .gy
Guyana .hk  Hong Kong (Hisiangkang, Xianggang) .hm  Heard & McDonald Islands
.hn  Honduras .hr  Croatia / Hrvatska .ht  Haiti .hu  Hungary .id  Indonesia
.ie  Ireland .il  Israel .in  India .infoInformation .int International .io
British Indian Ocean Territory .iq  Iraq .ir  Iran .is  Iceland .it  Italian
";
//
  var list3 = ".jm  Jamaica .jo  Jordan .jp  Japan .ke  Kenya .kg  Kyrgyz
Republic .kh  Cambodia .km  Comoros .kp  North-Korea .kr  South-Korea .kw
Kuwait .ky  Cayman Islands (UK) .kz  Kazakhstan .la  Laos .lb  Lebanon .lc
Saint Lucia .li  Principality of Liechtenstein .lk  Sri Lanka .lr  Liberia
.ls  Lesotho .lt  Lithuania .lu  Luxemburg .lv  Latvia .ly  Libya .ma
Marocco .mc  Monaco .md  Moldova .mg  Madagascar .mh  Marshall Islands .mil
Military .mk  Macedonia .ml  Mali .mm  Myanmar .mn  Mongolia .mo  Macau
(Ao-me'n) .mt  Malta .mu  Mauritius .mx  Mexico .my  Malaysia .mz
Mozambique .na  Namibia .nc  New Caledonia .ne  Niger .net Network .nf
Norfolk Island .ng  Nigeria .ni  Nicaragua .nl  Netherlands .no  Norway .np
Nepal .nu  Niue .nz  New Zealand .om  Oman .org Organization ";
//
  var list4 = ".pa  Panama .pe  Peru .pf  Polynesia .pg  Papua New Guinea
.ph  Philippines .pk  Pakistan .pl  Poland .pm  St Pierre & Miguelon .pn
Pitcairn .pr  Puerto Rico (USA) .pt  Portuguese Republic .pw  Palau .py
Paraguay .qa  Qatar .re  Reunion (France) .ro  Romainia .ru  Russia .rw
Rwanda .sa  Saudi Arabia .sb  Solomon Islands .sc  Seychelles .sd  Sudan .se
Sweden .sg  Singapore .sh  St Helena .si  Slovenia .sj  Svalbard & Jan Mayen
Islands .sk  Slovakia .sl  Sierra Leone .sm  San Marino .sn  Senegal .so
Somalia .sr  Suriname .st  St Tome & Principe .su  Soviet Union .sv  El
Salvador .sy  Syria .sz  Swaziland .tc  Turks & Caicos Islands .td  Chad .tf
France Southern Territory .tg  Togo .th  Thailand .tj  Tadjikistan .tk
Tokelau .tm  Turkmenistan .tn  Tunisia .to  Tonga .tp  East Timor .tr
Turkey .tt  Trinidad & Tobago .tv  Tuvalu .tw  Taiwan .tz  Tanzania ";
//
  var list5 = ".ua  Ukraine .ug  Uganda .uk  United Kingdom .um  US Minor
Outlying Islands .us  United States .uy  Uruguay .uz  Uzbekistan .va
Vatican City .ve  Venezuela .vg  Virgin Islands (British) .vi  Virgin
Islands (US) .vn  Vietnam .vu  Vanuatu .wf  Wallis and Futuna Islands .ws
Samoa .yu  Yugoslavia .za  South Africa  .zm  Zambia .zr  Zaire .zw
Zimbabwe ";
//
  var linklist = list1 + list2 + list3 + list4 + list5 + ".";
  return linklist;
}

function unknown_domain_extension_string (string) {
//
//
----------------------------------------------------------------------------
---------------------
//
-
//  Review the string primitive provided and see if it ends with a known
Internet domain extension.
//
//  INBOUND:  string = string primitive, typically containing an email
address or URL
//
//  OUTBOUND: function result = logical = .true. if there's a problem,
.false. if it's OK
//
//  Copyright 2004, ITM3 California.  All rights reserved.  ([EMAIL PROTECTED],
<http://www.itm3.com> http://www.itm3.com)
//  Written May 2004, revision 0.
//
-
//
----------------------------------------------------------------------------
---------------------
//
//alert("entering unknown_domain_extension_string with: \"" + string +
"\"");
//
  if (empty_string(string)) {
    return true;                                            // return .true.
when the string is empty
  }
//
  var known_extensions_linklist = known_domain_name_extensions();
//
  var index_dot = string.lastIndexOf(".");                  // find the last
"."
  var extension = string.slice(index_dot).toLowerCase();    // slice off
just the domain name extension
  var index = known_extensions_linklist.indexOf(extension); // search the
linklist for the extension
//
  if (index == -1) {
    return true;                                            // return .true.
when the extension is unknown
  }
  else {
    return false;                                           // return
.false. when the extension is known
  }
//
  return true;
}

--------------------

As in, "if (unknown_domain_extension_string(form_field.value) { issue
warning }"

Hope this helps!

-- Bing

Bradford Bingel ("Bing")
ITM3 California
 <http://www.itm3.com/> http://www.itm3.com/
[EMAIL PROTECTED] (email)
925-260-6394 (mobile)


-----Original Message-----
From: Action Request System discussion list(ARSList) [
<mailto:arslist@ARSLIST.ORG> mailto:[EMAIL PROTECTED] On Behalf Of
SUBSCRIBE arslist Neel
Sent: Thursday, May 17, 2007 6:36 AM
To: arslist@ARSLIST.ORG
Subject: Regular Expressions in AR 7.0.01

Hello fellow listers,

In application we use, we have an extensive use of email in our application
and I want to make sure that users are entering valid email addresses as we
have about 5-10 email errors/day with users entering invalid email address
(with special characters or white-space in email-address). Is it possible to
use regular expressions with ARs? If anyone could provide some examples,
that would be awesome.

Thank you,

Neel Gautam.


This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information.  If you have
received it in error, please notify the sender immediately and delete the
original.  Any other use of the email by you is prohibited.

____________________________________________________________________________
___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the
Answers Are"



_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the 
Answers Are"

Reply via email to