On Thu, 19 Mar 2020 17:48:31 +0000
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.
> Its far faster for me to write a series of tests in 'C' then try and
> work out what random gobbledygook will do the job in regex.
They're a tool like any other, useful when they help not so much
when they get in the way.
> Regex is for nerds to impress other people with. Its not a smart way to
> program.
They have their uses - dismissing a powerful tool is not a smart
way to program either.
> Same as SQL. By the time you have taken a day to write the SQL query
> that does everything you want, only to realise it takes 50 minutes to
> complete, you could have written most of it in C and got it down to 3
> seconds...
Complex SQL queries are often a mistake - but at least SQL is
reasonably consistent for the simple stuff.
--
Steve O'Hara-Smith | Directable Mirror Arrays
C:\>WIN | A better way to focus the sun
The computer obeys and wins. | licences available see
You lose and Bill collects. | http://www.sohara.org/
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|