use strict;
my $str = 'GBRG0A 00005 JULIEx 11/27/17 11:03:12 X3311073-00X DAMAGE
Dig No : X3311073 Rev : 00X Digstart: 11/27/17 11:01
Rcvd : 11/27/17 11:03 Priority: 0 Expires : 12/24/17 23:59
Org Dig: X3311073 Rcvd: 11/27/17 11:01
Firm : KNOX CONSTRUCTION Caller: DUSTIN KNOX
CoAddr1: 1386 BRIDGEPORT RD
City,St: MAQUON, IL Zip : 61458
Phone : 309-337-6576 Ext :
Call Bk: Done For : PATTY BAILEY
SiteCnt: DUSTIN KNOX Phone : 309-337-6576
County : KNOX Place: GALESBURG CIT
Address: 522 ISLE ROYALE RD
Subdiv : Cross: LOSEY ST
Grids : T11NR01E09SW
BestFit: 40.954957/-90.400618 40.954938/-90.399043
: 40.953819/-90.400632 40.953799/-90.399057
PreMark: YES Directional Boring: NO Depth>7Ft: NO
Locatn : IN THE CITY OF GALESBURG,
WrkType: FENCE POST INSTALLATION ***HIT LINE****
Extent : LOCATE: THE WEST SIDE OF THE HOUSE.
Remarks: REFER TO DIG# X003241591 TO ALL COMPANIES, CALLER STATES HIT A
: MISMARKED CENTURY LINK LINE. CREW IS ON SITE. CALLED IN BY DUSTIN.
Members: COMC0A GBRG0A GSD0A GSD0B IPC6A SCNT3A USIC0A
View map at:
http://newtin.julie1call.com/newtinweb/map_tkt.nap?TRG=32WSVUQRTTVORRtwo2';
my $regex = qr/Remarks: ([^\r]+)Members:/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