Claus,

When matching, you can match multiple patterns if you separate them with @VM. Eg: "1N0N":@VM:"'N/A'" matches one or more numerics or N/A.

try this (the logic from my email address validation subroutine):

The string must contain @ (unless you allow sending to users in your local domain without suppling the hostname).

Validate the local part and hostpart separately ([EMAIL PROTECTED]).

Validate localpart:
- May not be empty
- No longer than 64 characters
- Unquoted, Alphanumerics and !#$%&'*+-/=?^_`.{|}~ are all valid
- May not start or end with . and may not contain ..
- Any ASCII character may appear quoted with \ or if the localpart is a quoted string ""


Validate hostpart:
- May be an IP address if surrounded by square brackets ie:
MATCH "'['1N0N'.'1N0N'.'1N0N'.'1N0N']'"
You then need to make sure that no numeric component is greater than 255.
- Must contain at least one .
- Cannot be longer than 255 characters
- Each individual domain component (where hostpart is DOMAINCOMPONENT.DOMAINCOMPONENT.) may not be longer than 63 characters.
- You cannot have 0 length domain component (..) although you can have a trailing .
- The final DOMAINCOMPONENT (the .au, .com, .dk) cannot be all numeric
- DOMAINCOMPONENT may not start or end with -
- DOMAINCOMPONENT may only contain ascii alphanumerics and -


I then uses sockets to query our dns server and check that there is a Type A record for the domain.

I believe this should also work for the new internatianalised domain names but I have never tested it.

HTH,


Craig ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to