if( ! /my3\.exe/ and /my background error (\d+): (.+)/ ) { # do something with $1 and $2 }