mierlp Posted March 29, 2016 Posted March 29, 2016 Hi For creating a username in my application i use the customer e-mail address. Is there a example how to check if the entered e-mail address has a valid syntax with @ and . Regards Peter Quote
Nirlan Posted March 29, 2016 Posted March 29, 2016 I use this function: function ValidarEMail(vStr: string): Boolean; begin vStr := Trim(UpperCase(vStr)); if Pos('@', vStr) > 1 then begin Delete(vStr, 1, pos('@', vStr)); Result := (Length(vStr) > 0) and (Pos('.', vStr) > 2); end else Result := False; end; Quote
fcarvalho4 Posted March 30, 2016 Posted March 30, 2016 I use the extended events. You choose! ClientEvents -> UniEvents function beforeInit(sender, config) { Ext.apply(sender,{ allowBlank:false, vtype:'email', msgTarget : 'side' } ); } Quote
nim Posted March 30, 2016 Posted March 30, 2016 I use TRegEx var FoundMatch: Boolean; FoundMatch := False; try FoundMatch := TRegEx.IsMatch(S, '\A\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}\b\z', [roIgnoreCase]); except on E: ERegularExpressionError do begin // Syntax error in the regular expression end; end; 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.