with linux bash shell , how can i use regex to get a certain string of a file

by example:

for filename *.tgz
do 

"get the certain string of filename (in my case, get 2010.04.12 of file 2010.01.12myfile.tgz)"

done  

or should I turn to perl

Merci

frank


Question: What is the best introductory Bayesian statistics textbook?
Answer: Take a look at "The Bayesian Choice". It has the full package: foundations, applications and computation. Clearly written.