They're really created, but have a zero length? Bizarre...
But I can offer you a little regex help here. The think you're asking about "fo" vs "[foo]" is this. The former is merely a sequence, it matches the target string if the sequence "fo" occurs anywhere withing the string. The latter is a character-class: it matches any single character that is one of the enclose characters. Thus in [foo] the second 'o' is redundant, and it will match the same set by just giving "[fo]".
As far as your actual regex here:
if (eregi("htm", "$route_name"))
it seems needlessly broad, since it will match if the sequence "htm" occurs anywhere at all inside the string, rather than just an extension. Instead, you might want to ask for:
if (eregi('\.html+$', $route_name))
This says, match a dot followed by 'htm' followed by zero or one lower-case L's (due to the +), and this must occur at the end of the string (due to the $.)