Regex selection

i used this regex but i want result from Dispatch To Supplier which on 5 line in short i want only address from this document. so for that what will be the regex ?
thanks
cheers :slight_smile:

@monikanimbalkar send the text file or paste the test here as the way you get it from the source.

Yesh sure
PDF_Output (1).txt (1.6 KB)


hope this helps

2 Likes

did that help?
below is your text
and the regex https://regex101.com/r/caFBWI/2

Hi,

Probably you should use shortest match of regex as the following.

System.Text.RegularExpressions.Regex.Match(strData,"(?<=Despatch To)[\s\S]+?(?=Supplier)").Value

or

System.Text.RegularExpressions.Regex.Match(strData,"(?<=Dispatch To)[\s\S]+?(?=Supplier)").Value

Regards,

Choose Group 1
@monikanimbalkar