Emanuel Berg [2014-06-30 22:13:09 +02:00] wrote: > Emanuel Berg writes: >> Note that [A-Z] matches [a-z] as well (the lowercase equivalent) >> unless the variable case-fold-search is nil. > > It seems this isn't so. Well, all the better as it is less confusing. > [A-Za-z] is all the a-z chars in both upper- and lowercase, and [A-Z] > isn't [a-z]. It's very likely that when one writes [A-Za-z] he actually means "match any letter". So it's often better to write [[:alpha:]] instead since it also matches other letters than A-Z. Sometimes a good option is \w which matches word-constituent characters as defined in the current syntax table.