TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: AHEM A RIVET`S SHOT
from: RICHARD KETTLEWELL
date: 2020-03-20 08:27:00
subject: Re: Regexes and C

Ahem A Rivet's Shot  writes:
> The Natural Philosopher  wrote:
>> On 19/03/2020 13:18, Martin Gregorie wrote:
>> > So, can any of you do better, i.e. write a regex that CAN validate the
>> > syntax of an e-mail address in terms of its structure and the set of
>> > permitted characters on the username and domain parts (the permitted
>> > character sets are not the same).
>> No. That's why I don't bother with regex, ever.
>
>  In this case regex is not the problem, the problem is that email
> addresses are not designed to be parsed.

Yes, they are designed to be parsed and parsers for them exist (for
instance in most email software). The specifications have always
contained grammars for them. The language specified in RFC822 isn’t a
regular language, but that just means you need something a little more
sophisticated than a regular expression to parse it.

--
https://www.greenend.org.uk/rjk/

--- 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™.