in reply to Re: Why would one want in a regex a class with only a single entry?
in thread Why would one want in a regex a class with only a single entry?

first, a character class might contain a variable with as few as one character in it (/[$foo]/);

... and in that case, it's worthwhile to test the variable first, to make sure it contains something (i.e. length($foo)>0), because an empty string in that position is a runtime error, if I'm not mistaken.