const regex = new RegExp('CGK / WIII', '')
const str = `LOCATION REFERENCE UPLIFT TICKET TAIL FLIGHT AIRCRAFT DESCRIPTION UOM QUANTITY UNIT EXTENDED
NUMBER DATE NUMBER NUMBER NUMBER TYPE
SHIPPED PRICE PRICE
CGK / WIII 1208975-24101 24-MAR-21 08312411 VN-A633 VJ2432 Airbus 321 JET FUEL
USG -1,945.36 2.29783 (4,470.11)
1208975-24101 Total
-1,945.36 (4,470.11)
CGK / WIII 1208976-24101 26-MAR-21 08517889 VN-A633 VJ2432 Airbus 321 JET FUEL
USG -2,802.86 2.29783 (6,440.51)
1208976-24101 Total
-2,802.86 (6,440.51)
CGK / WIII 1208979-24101 28-MAR-21 08705413 VN-A633 VJ2432 Airbus 321 JET FUEL
USG -2,900.08 2.29783 (6,663.89)
1208979-24101 Total
-2,900.08 (6,663.89)
CGK / WIII Total
-7,648.31 (17,574.51)
Grand Total
-7,648.31 (17,574.51)`;
// Reset `lastIndex` if this regex is defined globally
// regex.lastIndex = 0;
let m;
if ((m = regex.exec(str)) !== null) {
// 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