Q:

Shell Globbing - Issues with wildcard matching

I am trying to write a pattern that will match any file name in a directory containing: a digit, immediately followed by a letter 'e' or 'h'.
(Example: 3e.txt)
I am required to test these patterns in the terminal/shell. I have tried writing several patterns, but they are all unable to find the 3e.txt and 3h.txt files that I have purposely placed in my working directory to test the patterns.
$ ls [0-9[e]*[h]*]?
$ ls [0-9][e]?

I am quite new to the shell, so I am not sure if I am using the wildcards correctly. How can I correct my pattern so it will match the file names I am searching for?

A:

Most shell do not support regular expressions. You can pipe ls in egrep for pattern matching:
$ ls | egrep '[0-9][eh]' 

