what a plug - obviously the only real purpose of this was to sell those t-shirts.
My favorite regex of all time
41–50 of 117 posts
Re: My favorite regex of all time
#42Earlier quoted context omitted.
For file names, URLs, domain names, etc. it's usually the safe thing to do.
Who's filenames aren't unicode? Also domains and URLs can be unicode too.
Re: My favorite regex of all time
#43This seems to be a T-shirt advert, why am I reading this on HN?
Re: My favorite regex of all time
#44Re: My favorite regex of all time
#45Earlier quoted context omitted.
Google is by far the best "comment"
Are you saying people should google regular expressions? in my experience (correct me if I'm wrong) that doesn't work, I've never been able to get google to return relevant results even with quotation marks.
Re: My favorite regex of all time
#46My favourite is this one: http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html
Re: My favorite regex of all time
#47This works for ASCII only, use unicode character classes instead.
Re: My favorite regex of all time
#48what a plug - obviously the only real purpose of this was to sell those t-shirts.
I'm sorry that was not the purpose. I just wanted to share this regex trick that I had in my mind. I added the shirts only later when I saw that the article is getting very popular. People really seemed to like my previous tees and it's great to make a little extra money and continue doing what I love - coding and writing blog posts.
Re: My favorite regex of all time
#49It's clever, but it's also completely unreadable for anyone who didn't read this article. Regexes have serious maintainability issues as it is; let's not make it worse by putting clever tricks in them.
I don't understand why this is "completely unreadable". What else could this have been besides match the character range from space to tilde?
Re: My favorite regex of all time
#50It's clever, but it's also completely unreadable for anyone who didn't read this article. Regexes have serious maintainability issues as it is; let's not make it worse by putting clever tricks in them.
I don't understand why this is "completely unreadable". What else could this have been besides match the character range from space to tilde?
I know there's some syntax I can use to create a zero width negative look behind recursive greedy named capture group back reference. Perhaps hyphen-tilde triggers something like that.