Is Match Activity

Hi All, I am having a text file from which I have to extract specific values. I want to extract all the (491) present in the file. I am making use of Regex and using Is Match activity. The issue I am facing is, when I am trying to print the data after the match, I am getting the complete file as the output instead of just (491).

I have my input as :

ext WIRE TYPE:WIRE OUT DATE:043021 TIME:0515 ET TRN:2021042900444636 SERVICE REF:004580 FED TYTYEK:20210430B6B7HU1R004580 RELATED REF Page 2Outgoing Money Transfer Debit (491) 11,594.96 903704290444636 000000000000 Text WIRE TYPE:WIRE OUT DATE:043021 TIME:0515 ET TRN:2021042900444636 SERVICE REF:004580 FED TYTYEK:20210430B6B7HU1R004580 RELATED REF:W0101205744181 ORIG:XXXXXXXX SOLUTIONS INC ID:86587892947594503

Here, I want to extract (491) and 11,594.96 from the entire data. Also, I have multiple lines matching the same pattern and I want to retrieve all of them. But when I am using Is Match activity, after I get a match, the data I am getting is the complete text instead of just (491). What can be done to retrieve just the matched data instead of complete data?

Hi,

How about the following?

mc  = System.Text.RegularExpressions.Regex.Matches(yourString,"\(491\)\s*[.,\d]+")

Main.xaml (8.6 KB)

Regards,

Hi @vaish.ayodhya ,
Will it always be (491) or this is the format and the numbers may change?

Hi @vaish.ayodhya

please see the attached file. It is also with match and how to write the output to console. It should help you.
SplitWordToChars.xaml (5.8 KB)

You can also subscribe my channel to see some helpful videos:

Best regards
Mahmoud

No, the number inside the bracket will change

Hi,

No, the number inside the bracket will change

Can you try the following pattern?

\(\d+\)\s*[.,\d]+

Regards,

Try this pattern
(\d{3})\s[\d.|,]+
and instead of is match try using Matches and as an output you’ll get a collection with all the matches