const regex = new RegExp('Remarks: ([^\\r]+)Members:', 'g')
const 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`;
// Reset `lastIndex` if this regex is defined globally
// regex.lastIndex = 0;
let m;
while ((m = regex.exec(str)) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
if (m.index === regex.lastIndex) {
regex.lastIndex++;
}
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(`Found match, group ${groupIndex}: ${match}`);
});
}
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 JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions