Programming

My favorite regex of all time

steloflute 2013. 6. 4. 23:30

http://www.catonmat.net/blog/my-favorite-regex/

 

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.

 

 

'Programming' 카테고리의 다른 글

How to set focus using javascript?  (0) 2013.06.24
HTML <textarea> readonly Attribute  (0) 2013.06.10
Turning JavaScript's arguments object into an array  (0) 2013.06.01
Building LISP  (0) 2013.05.27
Curried Functions in C  (0) 2013.05.14