All,
I have file names that will be always in the following format "rX_Q_Y_filename.mp3" where X and Y are numbers (0-9). FYI, X and Y in the filename can be 1 or more digits
example "r1234_Q_456789_filename.mp3"
How do I extract the 'Q_456789" part of the file name using bash script?

$your_string =~ /r.+_(Q_\d+)_filename\.mp3/; print $1;– m0skit0 Oct 7 '11 at 8:18