Hi I am trying to get the data between “MAIN ENGINE” and “AUXILIARY” using Regex (I needed to get the data highlighted in bold). This is a text I copy from a variable output
MAIN ENGINE 2 x Diesel - WinGD 6X72DF - 2-stroke 6-cyl. 720mm x3086mm bore/stroke 26,530mkW total at 69.10rpm.AUXILIARY 2 x Aux. Diesel Gen. - 4-stroke driving 2 x HD Hyundai Electric HSJ9 811-10P - AC generator(s) at 7,380ekW total, (9,225kVA total) 6600V at 50Hz. 2 x Aux. Diesel Gen. - 4-stroke driving 2 x HD Hyundai Electric HSJ9 803-10P - AC generator(s) at 5,540ekW total, (6,925kVA total) 6600V at 50Hz.PROPULSOR 2 x FP Propeller (Aft) (mechanical), 69.10rpm.OTHER ENGINE EQUIPMENT 2 x Screw Shaft.ENVIRONMENTAL EQUIPMENT 2 x Selective Catalytic Reduction - NOx - Unknown. 2 x BWTS - Ballast Water Treatment System - SunRui BC-3000 at 3000cu.m/hr.EMERGENCY 1 x Emergency Diesel Gen. - 4-stroke driving 1 x ac generator(s) at 50Hz.
Input= "MAIN ENGINE 2 x Diesel - WinGD 6X72DF - 2-stroke 6-cyl. 720mm x3086mm bore/stroke 26,530mkW total at 69.10rpm.AUXILIARY 2 x Aux. Diesel Gen. - 4-stroke driving 2 x HD Hyundai Electric HSJ9 811-10P - AC generator(s) at 7,380ekW total, (9,225kVA total) 6600V at 50Hz. 2 x Aux. Diesel Gen. - 4-stroke driving 2 x HD Hyundai Electric HSJ9 803-10P - AC generator(s) at 5,540ekW total, (6,925kVA total) 6600V at 50Hz.PROPULSOR 2 x FP Propeller (Aft) (mechanical), 69.10rpm.OTHER ENGINE EQUIPMENT 2 x Screw Shaft.ENVIRONMENTAL EQUIPMENT 2 x Selective Catalytic Reduction - NOx - Unknown. 2 x BWTS - Ballast Water Treatment System - SunRui BC-3000 at 3000cu.m/hr.EMERGENCY 1 x Emergency Diesel Gen. - 4-stroke driving 1 x ac generator(s) at 50Hz."
Output= System.Text.RegularExpressions.Regex.Match(Input,"(?<=MAIN ENGINE\s*).*(?=AUXILIARY)").Value
input_str=" MAIN ENGINE 2 x Diesel - WinGD 6X72DF - 2-stroke 6-cyl. 720mm x3086mm bore/stroke 26,530mkW total at 69.10rpm .AUXILIARY 2 x Aux. Diesel Gen. - 4-stroke driving 2 x HD Hyundai Electric HSJ9 811-10P - AC generator(s) at 7,380ekW total, (9,225kVA total) 6600V at 50Hz. 2 x Aux. Diesel Gen. - 4-stroke driving 2 x HD Hyundai Electric HSJ9 803-10P - AC generator(s) at 5,540ekW total, (6,925kVA total) 6600V at 50Hz.PROPULSOR 2 x FP Propeller (Aft) (mechanical), 69.10rpm.OTHER ENGINE EQUIPMENT 2 x Screw Shaft.ENVIRONMENTAL EQUIPMENT 2 x Selective Catalytic Reduction - NOx - Unknown. 2 x BWTS - Ballast Water Treatment System - SunRui BC-3000 at 3000cu.m/hr.EMERGENCY 1 x Emergency Diesel Gen. - 4-stroke driving 1 x ac generator(s) at 50Hz."