How to ignore the open close () bracket in regex using UIPATH

Hi Team,

Thanks in Advance…!

My Input is following like,
Anbu 23 is age of (a) 27
Mani 25 is age of (b) 29
Gokul 21 is age of (c) 25
Raja 23 is age of (d) 27

Expected output is 25 and I need to get the output only by regex not by split

Note:- The number all are dynamics

Thanks & Regards,
Anbumani S

HI @Anbumani

Can you be more specific.

Regards

Hi @Anbumani

Use the below regex,
image

Hope it helps!!

Hi @mkankatala ,

I’m getting the below error. Please advise.

image

Thanks…!

HI @Anbumani

Please use regexr.com , As you are using regex101 few erros will be occured.

Regards

I hope you find the solution for your query, If yes Make my post mark as solution to close the loop. Else post your queries here happy to help… @Anbumani

Happy Automation!!

Hi @mkankatala,

Thanks for your response. Apologies for delay response.

Also kindly find our exact requirement example.

Input:-
CODE DESCRIPTION AMOUNT
}}}} }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
A INVESTMENT INTEREST EXPENSE 1,234.
B * DEDUCTIONS - ROYALTY INCOME STMT 10
C * SECTION 12(E)(3) EXPENDITURES STMT 20
D * DEDUCTIONS - PORTFOLIO (OTHER) 56.
E SECTION 123(B) NEGATIVE ADJUSTMENTS 45.
F * OTHER DEDUCTIONS STMT 60

Here the line which starts with “E” has entire description and that needs to be included with the “E SECTION 123(B) NEGATIVE ADJUSTMENTS” of full description to get the value at last. Even if there is any star(*) included should also be considered in the description.

Expected output:-
For C row I’m need an output is 20.
For E row I’m need an output is 45.

Thanks…!

Okay @Anbumani

Use the below regular expression to get the required output,

(?<=\([A-Z]\).*[A-Z]+.*)(\d+)

Hope it helps!!

1 Like

Great, Thanks @mkankatala. Appreciate it.

It works for me…! :blush:

If possible,
Could you please share the separate regex for each row?

Expected output:-
For C row I’m need an output is 20.
For E row I’m need an output is 45.

Thanks…!

HI @Anbumani

Please check the below regex:

(?<=C.*\([A-Z]+\)\(\d\).*[A-Z]+\s+)(\d+)

(?<=E.*\d+\([A-Z]\)\s+[A-Z]+.*[A-Z]+\s+)(\d+)

Hope it helps!!

Hi @mkankatala,

Thanks for reply…!

I agreed, Your pattern gives the result for that regex. But I need regex for entire description.

For example,

  1. Input:- E SECTION 123(B) NEGATIVE ADJUSTMENTS 45

Regex:- (?<=E SECTION 123(B) NEGATIVE ADJUSTMENTS).* Need pattern like this.

Expected Output:- 45

  1. Input:- C * SECTION 12(E)(3) EXPENDITURES STMT 20

Regex:- (?<=C * SECTION 12(E)(3) EXPENDITURES STMT).* Need pattern like this.

Expected Output:- 20

Note:- Here the input is one line but the one line description will flows in bulk of notes.

Thanks…!

Could you please post this query as the new one. @Anbumani

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