Well-Formed email

Well-Formed email

_Bilal
Advocate Advocate
664 Views
5 Replies
Message 1 of 6

Well-Formed email

_Bilal
Advocate
Advocate

Hello,

 

Is there an AutoLISP routine that checks if an email is well-formed?

 

Thanks,

0 Likes
Accepted solutions (1)
665 Views
5 Replies
Replies (5)
Message 2 of 6

Kent1Cooper
Consultant
Consultant

Why would you want to be in an AutoCAD drawing to check an email, for anything?  How would you propose to get the email into AutoCAD to check it?  And if you have good reason to, and can get it in, what constitutes "well-formed"?

Kent Cooper, AIA
0 Likes
Message 3 of 6

_Bilal
Advocate
Advocate

I have an AutoCAD Application which links the user to his account in the website via a DCL dialog as per the below figure

_Bilal_0-1631264400925.jpeg

 

I am changing this DCl Login dialog to be used as Login (for already registered users) and Sing Up (for a new User).

In this case, I need to checkup the new user's email before sending the HTTP request to the server with User data (email password), I prefer to do that (email well-format checkup) in the AutoCAD session and not on the website PHP function.

 

As I know the well-formatted email shall be as follow:

Valid Name Part in Email Address with Example:

  1. lowercase Latin letters: abcdefghijklmnopqrstuvwxyz,
  2. uppercase Latin letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ,
  3. digits: 0123456789,
  4. special characters: !#$%&’*+-/=?^_{|}~,
  5. dot: . (not first or last character or repeated unless quoted).
  6. space punctuation such as: "(),:;<>@[\] (with some restrictions).
    comments: () (are allowed within parentheses, e.g. (comment)xyz@example.com).
 
0 Likes
Message 4 of 6

hak_vz
Advisor
Advisor
Accepted solution

You should use regex expressions. Here is a autolisp code to work with regex posted at site by @_gile .

Search over the internet and look for regex expressions to check emails. There are simple forms that only check for @ sign in string, to more bulletproof solutions.

 

 

https://gilecad.azurewebsites.net/LISP/RegExp.lsp 

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 5 of 6

Kent1Cooper
Consultant
Consultant

@_Bilal wrote:

....

Is there an AutoLISP routine that checks if an email is well-formed?

....


In my mind, "an email" is a message sent by email.  But it's now apparent that you're talking about an email address.

Kent Cooper, AIA
Message 6 of 6

_Bilal
Advocate
Advocate

Thank you for this useful guide

0 Likes