Assuming that you are talking about a file name such as 1somethingorother2.something, normal wildcards such as * and ? should work.
$ ls 1*2.txt
$ ls 1???2.txt
$ ls *1*2*.*
For something more complicated, you may need to use regular expressions. See man regex
for more, then Google for links to make the man page understandable.