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

[ -~]

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

.

.

.

.

.

.

.

.

It matches all ASCII characters from the space to tilde. What are these characters? These are all printable characters!

Take a look at this ASCII table. Printable characters start at the space and end at tilde (in light blue background). Non-printable characters are all remaining characters (in white background).

[ -~] matches all printable ASCII characters.

I love this so much!

My Second Favorite Regex

This was my favorite regex of all time but I also have another favorite regex. It's [,-.]. Do you know what this one does? Read my post to find out!

My Third Favorite Regex

I was thinking and realized I had the third favorite regex. It's [A-z]. I bet you're scratching your head. Read my third post to find out!

ASCII Regex T-Shirt

Want to wear this regular expression? I just had an idea to put it on a t-shirt as this blog post was getting so popular. Check out this limited-edition t-shirt that I made.

Update: Sold out and no longer available.

See you next time!