Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

E-mail validation

Status
Not open for further replies.

gmdin

Programmer
Nov 15, 2001
1
US
I am trying to validate a e-mail field in the datawindow so that it is in the form of a@b.c
where 'a' has
--characters from a to z and upper case A to Z
--Hypens(-)
--Underscores(_)
--Periods(.)
it should check for @ sign,

'b' should check all of the contents in 'a'

The period after 'b' should be checked

'c' should be no less than two characters and not more than six characters.

Please help

Thanks
 
Something along these lines:
( NOT Match(GetText(),~"[^A-Za-z0-9\.@_\-]~") OR NOT (Match(GetText(),~"[@+]~") AND Match(GetText(),~"[/.+]~"))) AND NOT (pos(GetText(), ~".~") = 1 OR pos(GetText(), ~".~", Len(GetText())-1) = Len(GetText()) OR pos(GetText(), ~"@~") = 1 OR pos(GetText(), ~"@~", Len(GetText())-1) = Len(GetText()) OR Pos(GetText(),~".@~")>0 OR Pos(GetText(),~"@.~")>0)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top