use strict;
my $str = 'SWT KIS VCS Stat;08.09.2018 22:33:36;;U=366570 P=2 Z=362850, WW=0, L=braswt 0501 B=BRA TRIANGLE D=00:19 E:Internal user,CC=End by Internal User, Name=PHIF_10, Address=302E0;';
my $regex = qr/U=(?<mfcsrc>\d{6})\sP=(?<mfcprio>\d)\sZ=(?<mfcdst>\d{6}),\sWW=(?<mfcWW>\d*),\sL=(?<mfcline>.*)\sB=(?<mfctrunk>.*)\sD=(?<mfcdur>\d\d:\d\d)\sE:(?<mfcCC>.*),CC=(?<mfcCCC>.*),\sName=(?<LOWW_IF>.*),\sAddress=(?<vcsNODE>.{5});/p;
if ( $str =~ /$regex/g ) {
print "Whole match is ${^MATCH} and its start/end positions can be obtained via \$-[0] and \$+[0]\n";
# print "Capture Group 1 is $1 and its start/end positions can be obtained via \$-[1] and \$+[1]\n";
# print "Capture Group 2 is $2 ... and so on\n";
}
# ${^POSTMATCH} and ${^PREMATCH} are also available with the use of '/p'
# Named capture groups can be called via $+{name}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html