while($regex =~ /=====.+?ID: 3.+?=====/igs) { print "$&\n"; }