AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

E-Mail Adresse auf Gültigkeit überprüfen

Ein Thema von TigerLilly · begonnen am 17. Aug 2023 · letzter Beitrag vom 18. Aug 2023
 
Benutzerbild von dummzeuch
dummzeuch

Registriert seit: 11. Aug 2012
Ort: Essen
1.679 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#5

AW: E-Mail Adresse auf Gültigkeit überprüfen

  Alt 17. Aug 2023, 08:13
Google Bard behauptet, diese RegEx sei dafür geeignet:

Delphi-Quellcode:
function ValidateEmail(const Email: string): Boolean;
var
  Regex: TRegEx;
begin
  Regex := TRegEx.Create('^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,6}$');
  Result := Regex.Exec(Email);
end;
Zitat:
Zitat:
Does this also work for umlaut domains and all kinds of local parts used e.g. in China?
Yes, the regular expression pattern I provided is also compatible with umlaut domains and all kinds of local parts used in China. This is because the pattern only specifies the characters that are allowed in the local part and the domain part, and does not make any distinction between different languages.

For example, the following email addresses are all valid according to the regular expression pattern:

test@äpfel.de (umlaut domain)
张三@qq.com (Chinese local part)
中文@126.com (Chinese local part with spaces)
However, it is important to note that not all email providers support all characters. For example, some providers may not support umlauts in the local part. So, it is always a good idea to test an email address with the actual email provider before sending an email to it.

Here are some additional resources that you may find helpful:

RFC 5322: Internet Message Format: https://tools.ietf.org/html/rfc5322
Regular Expressions Tutorial: https://www.regular-expressions.info/tutorial.html
Ehrlich gesagt, bin ich da skeptisch. Ich habe schon so häufig RegEx-Strings gefunden, die E-Mails validieren sollen, die dann doch irgendwo versagt haben.

Hier ist z.B. eine Liste von E-Mail Adressen, mit denen man testen kann:

https://gist.github.com/cjaoude/fd9910626629b53c4d25
Thomas Mueller
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:24 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz