I have scrap data and need to extract specific value

I have data like,

KI:NDA xxxx

some data…

MM -494000 MM + UM -235465 MM + UM + MK -23600

KI: NDA

some data…

MM -99000 MM + UM -2354455 MM + UM + MK -23600

some data…

so…on…

I want to at least one of “MM” has negative value or not
MM will appear 1 or multiple times.

Couldn’t understand the above part, could you be more specific.

I want to find out whether MM has any negative value or or not.

As there are multiple appearances of MM with some numbers adjacent to it, so i have to find out at least one of the MM have negative number.

Hi,

Use this regular expression which gives list of matches adjacent to MM

(?<=MM )[\W\d]+(?=MM)
or
(?<=M )[\W\d]+(?=MM)

Now you have all the values, convert them to integer and check whether the value is greater than 0, by using if condition, if the value is less than 0 break the loop and take the item.

You can test the above regex in https://regex101.com/ with the above text mentioned.

Refer the below workflow for reference.

Queue.xaml (7.9 KB)

Thank you so much. Its working with regex . I have use regex “^[Mm]{2}\s{2}-\d*”"

Hi, @kalv

In my scenario I have made constant as MM and based on this constant I will be extracting the next part that is number and again I am taking MM as constant so it never fails,

But if you want to use your regex that’s totally fine.

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