How to perform Regex for the above line

Hi,
Here I m posting a sample txt file I need to perform Regex. I only want to extract that line (“NEW ABCDEF PARTS”)from the particular txt file, using the regex .I tried look ahead and look behind activity, But I’m not able to fix it. Here the invoice no provide as 100,in all the Scenarios it is not provided.

~Customer: Customerdata1.PO No.: 12345677
~UserandBuyers: ABCDE1
Eng Name: Primary 12100D Secondary 11234
~Engines Availability: EngineNo1 and EngineNo2~~Invoice No.: 100

NEW ABCDEF PARTS
PART NAME

Hello @Chippy_Kolot , If you can, send iput as a text and mention you expected output

@Chippy_Kolot
Var1="~Engines Availability: EngineNo1 and EngineNo2~~Invoice No.: 100

NEW ABCDEF PARTS
PART NAME"

Sysytem.text.regularExpression.regex.Match(Var1, "\S.+\n(?=PART NAME)").toString

image

@Chippy_Kolot
If “PART NAME” is constant,

Then use this regex

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.