Cannot be converted to string error

System.Text.RegularExpressions.Regex.Matches(item, “$\d+(.\d+)*”) cannot be converted to string ? how so solve this one ?

I have a matches then i use for each for each item from the matches the type argument of for each is string and I wanted to assign each item to item = System.Text.RegularExpressions.Regex.Matches(item, “$\d+(.\d+)*”) but I got that error , any idea thanks

Any help would be appreaciated thanks.

Hi @Jelrey,

what you can do is in a IF activity you can check for the regex pattern like System.Text.RegularExpressions.Regex.isMatch(item.tostring,“$\d+(.\d+)*”)

then to extract the pattern value or the regex value you can use something like :

System.Text.RegularExpressions.Regex.Match(item.toString,“$\d+(.\d+)*”).Value

you can get your desired results.

Let me know for any clarifications .

Cheers
Shikhar

I wanted to remove all the dollars from the item , please check this one Sir . for example if $656.88 then remove it using regex. pleasee see my code below.

Main.xaml (8.4 KB) project.json (1.0 KB)

example data is Homeowner’s Insurance Premium ( 12 mo.) toAmerican Family $893.00
Insura

using that regex inside the loop the final output would be Homeowner’s Insurance Premium ( 12 mo.) toAmerican Family Insura , dollar was removed