there is a regular https://regex101.com/r/GD5G8f/2

Here is the code

my @events = ("CALL", "DBMSSQL"); local $" = "|"; foreach($txt =~ /(^\d\d:\d\d\.\d+[-]\d+,(?|@events)(?:.*?)(?|Method[^,]+|Context=([^'][^,]+)|Context='([^']+)).*?$)/gm) { say "======="; say $1; # ParsLine($txt); } 

in the console it outputs the same thing, but each of the matches is necessary. Something with flags messed up?

  • so my @q = $txt =~ /(^\d\d:\d\d\.\d+[-]\d+,(?|@events)(?:.*?)(?|Method[^,]+|Context=([^'][^,]+)|Context='([^']+)).*?$)/gm; - nörbörnën
  • Damn, I’m using $ 1 in the body of a cycle, but $ _ is needed - Artem Artymych
  • and how here "thanks" to put? Or can not comment? - Artem Artymych
  • just delete the question - nörbörnën

0