http://www.perlmonks.org?node_id=998720

surib has asked for the wisdom of the Perl Monks concerning the following question:

My pattern search needs to match both files:
3B40RT.2000033121.7.bin.gz 3B40RT.2000033121.7R.bin.gz (added 'R' to filename)
Original pattern search was:
$fileName =~ /3B4[0|1|2]RT\.\d{10}\.\d+\.bin/)
This worked fine until the 'R' was added for reprocessed files. I've tried:
$fileName =~ /3B4[0|1|2]RT\.\d{10}\.\w+\.bin/ $fileName =~ /3B4[0|1|2]RT\.\d{10}\.\{1,}\.bin/ $fileName =~ /3B4[0|1|2]RT\.\d{10}\.\d+R?\.bin/ $fileName =~ /3B4[0|1|2]RT\.\d{10}\.\dR?\.bin/
Any suggestions?