linux – Perl regex with Subexpression containing .* is running slow in oracle linux9 with perl 5.32.1

ts-utc!=!2024-12-26T05:38:54.649609!;!alertCount!=!0!;!alertIdName!=!TEST!;!nodeType!=!NA!;!pid!=!4091773!;!portNo!=!NA!;!location!=!A2923!;!errorMsg!=!NOT!;!

Above is input file to below Perl script which runs fine on CentOs7 Perl 5.20 but same script is taking more than 1 minute to run on Oracle Linux9 Perl 5.32. I require help in speeding up the script.

#!/usr/bin/perl
#
$file="test.xml";
$aMatchString='(?=.*location!=!A2923!)(?=.*!errorMsg!=!TESTING)';

while (<$fileH>) {
# check if the string from the file matches
         if ($_ =~ m/$aMatchString/) {
             print "FOUND\n";
             print $_;
         }
         else {
             print "no found\n";
         }
     }

Read more here: Source link