I thought I'd share my favorite regex of all time.

[ -~]

Any ideas what this regexp matches? Scroll down for the answer.

.

.

.

.

.

.

.

.

It matches all ASCII characters from the space to tilde. What are those characters? They're all printable characters.

Take a look at the ASCII table. Printable characters start at the space and end at tilde:

[ -~] matches all printable ascii characters (light blue background).

I love this!

ASCII Regex T-Shirt

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: Sold out and no longer available.