use strict;
my $str = 'source/parsers/x509.d(149,21): Error: function `std.typecons.Nullable!(Address[]).Nullable.length() const` is not callable using argument types `(ulong)`
source/parsers/x509.d(149,21): expected 0 argument(s), not 1
source/parsers/x509.d(151,60): Error: cannot implicitly convert expression `parseAddress(cast(const(char)[])split(cur_line[17], header.set_seperator)[i], null)` of type `std.socket.Address` to `Address[]`
source/parser.d(83,30): Error: template instance `parser.Parser.summarize!(X509)` error instantiating
Error /home/steveno/dlang/dmd-2.101.0/linux/bin64/dmd failed with exit code 1.';
my $regex = qr/(?<filename>[a-zA-Z0-9\\-\\.\\/_]+.d)(?<line>\(\d+),(?<column>\d+)\): (?<level>.+(?=:))(?<message>.*)/p;
if ( $str =~ /$regex/ ) {
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