In your post, you're not "grepping filenames", but
grepping text that is the result of an
ls command, containing file names.
As you pointed out, you need to differentiate between "grepping and globbing", which are not the same even though it sometimes may seem so. Either is a malapropism; the exact terms would be "regex matching" and "pattern matching".
"Globbing" deals with patterns and is done by the shell, mostly when dealing with directory contents. And, in one exceptional case, some recent shells can deal with regexes: in "conditional expressions".
man bash:
Quote:
A ... binary operator, =~, is available ... the string to the right of the operator is considered an extended regular expression and matched accordingly
"Grepping" deals with regexes, basic and extended, abbr. BREs and EREs. They have many subtleties, and it pays off to spend some time reading the man page.
Patterns and regexes in principle have different syntaxes. There are some overlaps, e.g. the
[...] bracket expression meaning "Match any one of the enclosed characters", but also "faux amis" (false friends) like the
* . It's always annoying to keep those differences in mind when dealing with either, and I have to test and experiment every single time when I switch from one to the other.