Comment

Comment by sweeneyrod

This seems cool, but I think that's mostly because the regex you think of as a point of comparison is something like

    r'^[\w.%+-]+@[\w.-]+\.[a-zA-Z]{2,6}$'
which does look awful. But there's no reason you can't do

    username = r'[\w.%+-]+'
    domain = r'[\w.-]+'
    tld = r'[a-zA-Z]{2,6}'
    email = username + r'@' + domain + r'\.' + tld
which is arguably easier to read than the rxe version for someone familiar with regex.
parent sweeneyrod 7 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton