Rgex help needed to extract 2 fields

Hi want to extract 2 fields from below highlighted text please help

Loan Account Number: Borrower Name:
200641216 Realty Corporation
Payment Details (Optional):
107-109 Vermilyea Ave
3020-1172645

Checkist Items (Required: Please choose one) Done

image
(\d{9})
image
(?<=[A-Z a-z():]+\s+)\d{3}-\d{3}\s+[A-Za-z \s]+\d{4}-\d{7}

1 Like

I’ve edited it again please check and help to extract text in bold letters

@Sudheer_Kumar1

system.text.RegularExpressions.Regex.Match(inputstr,"(?<=Borrower Name:)\n.*\n\d+").Value.trim

system.text.RegularExpressions.Regex.Match(inputstr,"(?<=\(Optional\):)[\s\S]+").Value.trim

can try this

1 Like

Hi,

How about the following?

m = System.Text.RegularExpressions.Regex.Match(yourString,"Loan Account Number: Borrower Name:\s+(?<FIRST>\d+)[\s\S]+?Payment Details \(Optional\):\s+(?<SECOND>[\s\S]+?)Checkist Items \(Required: Please choose one\)")

Then

m.Groups("FIRST").Value
m.Groups("SECOND").Value

note: m is Match type

Sample
Sequence3.xaml (6.7 KB)

Regards,

1 Like

Hi @Sudheer_Kumar1

Try this

\d+\-.*|\d+

(\d+\-\d+\s*\w.*\n\d.*)|\d+

Hope this helps!!

Hi @Sudheer_Kumar1

Input= "Loan Account Number: Borrower Name:

200641216 Realty Corporation

Payment Details (Optional):

107-109 Vermilyea Ave

3020-1172645"

Output= System.Text.RegularExpressions.Regex.Match(Input,"(?<=Borrower Name:\s\n)\d+").Value
Input= "Loan Account Number: Borrower Name:

200641216 Realty Corporation

Payment Details (Optional):

107-109 Vermilyea Ave

3020-1172645"

Output= System.Text.RegularExpressions.Regex.Match(Input,"\d+\-\d+\s*\w.*\s*\n.*").Value


Hope it helps!!

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