Regex Pattern to find total amount

Hi Team
I need to get the total amount from the below pattern

1st pattern is to find the header from the file
2nd pattern is to find the below subheadings from the 1st Pattern

Im using regex ismatches activity

1st regex
Pattern= “Taxes & Fees(\s\S]*?)(ADD/APPENDIX)”
Pattern options = Ignorecase,Complied
Text to search in = XML_File.replace(“&”,”&”)
First Match = Taxes_tosearch

2nd regex
pattern= “(T1|T2|T3|T4|T5)\s*$([0-9,]+(?:[0-9](1,2}))”
Pattern options = Ignorecase,compiled
Text to search = Taxes_tosearch
Result = Taxes_List

Now i need to get the total amount from the pattern.

@smarthari1997 ,

Please share input sample string or file please.

Thanks,
Ashok :slight_smile:

@smarthari1997

Can you attach the input and output sample please

sorry ashok im working in client network i cant share the input file could you pls provide me any other suggestions

Hi @smarthari1997

Please share your input and expected output text and your requirement so that I can help you out with regular expressions and flow.

Regards

Hi @smarthari1997

Can you share sample dummy data instead of confidential data

dummy sample could be fine but without it no one could be able to help you!

Hi, untill and unless you share a sample data of input string, it would be difficult for anyone to recommend you any regex. Share a sample data (change actual values, if you can shared any actual case).

I would modify the second regex to: (T1|T2|T3|T4|T5)\s*\$(?<total>[0-9,]+(?:[0-9]{1,2}))

image

After that you can retrieve the amount with the named group: m.Groups("total").Value

image