VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A VERY concise and powerful Email Validator: only 5 lines of code. uses regular expressions (very P

by Brian Wallace (1 Submission)
Category: String Manipulation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Fri 5th January 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

A VERY concise and powerful Email Validator: only 5 lines of code. uses regular expressions (very Powerful also...) ?Enjoy?

API Declarations


Example:
ValidateAddresss("[email protected]")


thats it...
I suppose you could declare it as a global/public function if you wish

this would match:
[email protected]
[email protected]
[email protected]
[email protected]

would NOT match
look at [email protected]
[email protected]




Rate A VERY concise and powerful Email Validator: only 5 lines of code. uses regular expressions (very P



Dim re
  Set re = new RegExp
  re.pattern = "^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$"
  ValidateAddress = re.Test(Addy)
set re = nothing
End Function

Download this snippet    Add to My Saved Code

A VERY concise and powerful Email Validator: only 5 lines of code. uses regular expressions (very P Comments

No comments have been posted about A VERY concise and powerful Email Validator: only 5 lines of code. uses regular expressions (very P. Why not be the first to post a comment about A VERY concise and powerful Email Validator: only 5 lines of code. uses regular expressions (very P.

Post your comment

Subject:
Message:
0/1000 characters