How to uniquely identify field using regex pattern?

Hi all,

I’m trying to extract the value of field “Total” using Regex Pattern of “Matches” Activity.

Fields available :
Total $93.50
Sub Total $85.00

Pattern I gave :
(?<=Total)(.*)
Output I’m getting:

image

But I want to fetch only TOTAL value.

Any help would be appreciated:-)

@Vaishnav_Tej

Please try this

(?<=^Total.*)\d+.\d+
image

cheers

Hi,

Can you try the following pattern?

(?<=(?<!Sub\s*)Total\s*)\$\d+

OR

(?<=(?<!Sub\s*)Total\s*\$)\d+

Regards,

This expression is not extracting any of the values.
It just started execution and ended.

Hello sir,

This expression is not fetching decimal values.

Hi,

Sorry, how about the following?

(?<=(?<!Sub\s*)Total\s*)\$[.,\d]+

OR

(?<=(?<!Sub\s*)Total\s*\$)[.,\d]+

Regards,

Thank you sir. It’s working perfectly.
Could you please share any link where I can learn regex.

@Vaishnav_Tej

Please include like this

System.Text.RegularExpressions.Regex.Matches(str,"(?<=^Total.*)\d+\.\d+",RegexOptions.Multiline)(0)

cheers

1 Like

Actually I’m using Matches activity and inside pattern property I’m passing the expression.
Thanks for your response:-)

@Vaishnav_Tej

Even there you have this option

cheers

oh Could you please share any link where I can learn about Regex ?

@Vaishnav_Tej

cheers

For now, the following might help you as first step.( However, this might be easy for you because you already know look behind.)

Regards,

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