Issue with Regex Matching in UiPath - Unable to Retrieve after newline Values

Hello, Team. I have input like this below.
“2.BUYER’S NAME & ADDRESS
LET EXPORT COPY
SMR AUTOMOTIVE SYSTEMS INDIA LIMITED SMR AUTOMOTIVE VISION SYSTEMS MEXIC”

I want to use this regex: “(?<=BUYER’S NAME & ADDRESS\s(LET EXPORT COPY)?\n).*” It works well in the regex builder , however when debugged, it returns a blank value.

Output which I want “SMR AUTOMOTIVE SYSTEMS INDIA LIMITED SMR AUTOMOTIVE VISION SYSTEMS MEXIC”

@Kumar_Anish_SMR

(?<=BUYER’S NAME & ADDRESS\s+(LET EXPORT COPY)\s+).*

or Try this both approaches work

(?<=BUYER’S NAME & ADDRESS\s(LET EXPORT COPY)?\s+).*

Hi @Kumar_Anish_SMR

Try to configure the Find Matching Patterns this way and try:

Regards

image
No @rlgandu that not work for me

@Kumar_Anish_SMR

(?<=BUYER[\s\S]*?COPY\s+).*
System.Text.RegularExpressions.Regex.Match(Str,"(?<=BUYER[\s\S]*?COPY\s+).*").Value

Please try this hope it works for you

Hi,

Can you try the following expression?

System.Text.RegularExpressions.Regex.Match(strData,"(?<=BUYER'S NAME & ADDRESS(\s+LET EXPORT COPY)?\r?\n)(?!LET EXPORT COPY).*").Value

Sample
Sample20240701-3.zip (2.9 KB)

Regards,