Hyphen between two characters means range
[a-z] is the same as [abcdefghijklmnopqrstuvwxyz], but you'd never write the long form. The hyphen between two characters defines a range based on the underlying character codes (ASCII / Unicode codepoints).
The big three you'll use constantly:
[0-9]— any digit (ASCII)[a-z]— any lowercase ASCII letter[A-Z]— any uppercase ASCII letter
You combine them: [a-zA-Z0-9] is alphanumeric. [a-fA-F0-9] is hexadecimal. [가-힣] is Korean Hangul syllables (the entire syllable block).
Don't be clever with ranges
Ranges work on whatever the codepoint order is. [A-z] looks like "any letter" but actually includes the punctuation between Z (90) and a (97): [ \ ] ^ _ `. This is a real bug class. Always write both halves: [A-Za-z].
Hyphen at start, end, or escaped is literal
To match a literal hyphen inside a class, put it first ([-a-z]), last ([a-z-]), or escape it ([a\-z]). Anywhere else, it forms a range. Most style guides put it first or last for clarity.