A very common character class pattern you will come across in the world of regular expressions is [a-zA-Z] which is just matching the letters of the English alphabet in upper and lower case. Here’s a tip if you are going to use a range in a character class, especially of alpha characters, unless it matters to some other part of your pattern you may want to make the regex case sensitive. In the above example it only stops your pattern from being redundant which is reason enough since a case insensitive [a-z] or [A-Z] would match exactly the same characters. Another reason, and maybe a better one, is that it will save you some headaches if you deal with Unicode characters outside the ASCII range.
Take the pattern [\u0100-\uFFFF] which should match any non-ASCII (and non extended ASCII) character. I pointed out a bug with the non-plane 0 Unicode characters awhile back. This pattern was the first step in matching all the non-ASCII Unicode characters, by first matching the non ASCII character in plane 0. Unfortunately it matched every instance of the letter “I”. As we all know “I” is one of our favorite ASCII characters. Every tool I tested this with returned the same match except the regexlib using the JavaScript option. I was about to declare this as a bug, when a little more research allowed me to track down the characters a causing the problem. U+0130 and U+0131 two Unicode variations on the letter I which if made case insensitive are the same as an ASCII “I” according to the regex engine. That’s when I realized that every tool I had been testing with has case insensitive turn on by default. If you stop the think about case insensitive allow searching outside of the range specified. So far “I” seems to be the only letter in the English alphabet that falls into this quirk though that could change as new characters are added, but this may happen with alphas from other languages or with other characters.
It only requires three keystrokes per cases and it allows you to limit the range to exactly what you specify in the pattern. That way you won’t have to sift through 65,000+ characters to find the one throwing things out of whack