TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: MARTIN GREGORIE
from: THEO
date: 2020-03-20 11:44:00
subject: Re: Regexes and C

Martin Gregorie  wrote:
> I spent more time than I should have yesterday trying to understand
> regcomp(), regexec() and regerror() well enough to validate a string
> containing an e-mail address string to make sure that: its structure is
> correct and neither the username nor the domain contains characters they
> shouldn't.

For all of you trying to do this in regexes, I present some test cases:

用户@例子.广告               (Chinese, Unicode)
अजय@डाटा.भारत               (Hindi, Unicode)
квіточка@пошта.укр          (Ukrainian, Unicode)
θσερ@εχαμπλε.ψομ            (Greek, Unicode)
Dörte@Sörensen.example.com  (German, Unicode)
коля@пример.рф              (Russian, Unicode)

courtesy of:
https://en.wikipedia.org/wiki/International_email

I hope your code handles them appropriately :)

Theo

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.