re = /CGK \/ WIII/
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)'
# Print the match result
str.match(re) do |match|
puts match.to_s
end
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 Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html