Follow me on Twitter for my latest adventures!
I thought I'd share my favorite regex of all time:
Any ideas what this regexp matches?
It matches all ASCII characters from the space to the tilde. What are those characters? They're all printable characters!
Take a look at the ASCII table. The printable characters start at the space and end at the tilde:
[ -~] matches all printable ascii characters (light blue background)
I love this.
Would you like to wear this regular expression? I just had an idea to make it a t-shirt as this blog post is getting so popular. Check out this t-shirt that I made:
Update: No longer available.
This shirt is available through Teespring. Teespring is like Kickstarter for t-shirts. If 50 people buy the shirt, everyone gets their shirt. Otherwise no one gets charged and no one gets the shirt.