RegularExpression not working

Hi.

This regex is not working.
Convert.ToInt32(system.Text.RegularExpressions.Regex.Match(Upd_InterestRateValue.ToString,"\d.+\W.+\d"))

I have tried every Variable type but none is perfect :frowning:

help me please. thanks in advance

2 Likes

Hi
it seems like there is a , or . between integers
in that case instead of INT32 variable convert that to double variable
like this
Convert.ToDouble(system.Text.RegularExpressions.Regex.Match(Upd_InterestRateValue.ToString,"\d.+\W.+\d").ToString)

or if its not
then
Convert.ToInt32(system.Text.RegularExpressions.Regex.Match(Upd_InterestRateValue.ToString,"\d.+\W.+\d").ToString)

Cheers @Latif

Hi @Latif

May I know what was the input you giving and try to convert?

Regards,
@Spark_robot

1 Like

Should be
Convert.ToInt32(system.Text.RegularExpressions.Regex.Match(Upd_InterestRateValue.ToString,"\d.+\W.+\d").Value)

1 Like

image
I just wanted to take out this “I alt” text out and rest i want in variable even the amount is in minus or plus.

1 Like

Fine
then the expression would be like this
str_output = Split(str_input,":").Last.ToString.Trim

where str_output is a variable of type string

Cheers @Latif

palamiyappan


I alt: -258,39
I just want to remove “I alt: "
I want value either its in plus or minus
this Upd_ConvIntRateValue variable have assign value Convert.ToInt32(system.Text.RegularExpressions.Regex.Match(Upd_InterestRateValue.ToString,”\d.+\W.+\d").ToString)

so i need to create a new assign activity?

2 Likes

we can use with split method
or
if we want to go for regex then the expression would work
str_Upd_ConvIntRateValue = system.Text.RegularExpressions.Regex.Match(Upd_InterestRateValue.ToString,"\W(\d)+\W+(\d)+").ToString

where str_Upd_ConvIntRateValue is a variable of type string
as int32 variable cant take value with minus in it
so we can store them in a string variable and later if we want we can remove that minus with .Replact("-","")

Cheers @Latif

I didt get it please help

this split method will split the string based on : as delimiter
where we want the last part of string right…thats what it gives us
no worries
can i have a sample of input strings
@Latif

Its working with splid method and much easy to understand…
Now I want this value out of this sequence(.xaml) file and put to another file.
I tried with argument means putted this split value into argument variable but its not working and not showing result.

1 Like

Awesome

Fine
Is that argument is set with OUT direction
And
Once after creating a argument in this workflow with out direction assign this value as input to this argument using a ASSIGN ACTIVITY In this workflow

So when we invoke this workflow using INVOKE WORKFLOW FILE Activity inside the workflow B we can click on Import arguments option and that would import the arguments alone
To get that argument value ,Now create a variable named str_input in workflow B and mention that in the value part
To mention that click on Arguments property in the property panel of Invoke workflow file activity

Now this variable str_input will have that value we want

Now

I did it exact the same as you told before writing it… but its not importing the value.

image

You can see the output result and programing.

Let me know the error…

2 Likes

Can someone help me …
Why it shows an empty row when I try to import the Split value into another flow?

Kindly reply… on my issue

1 Like

Hi
I can see like the value got printed inside the invokes workflow along with the string
Output splitter value is : -260,76

But it’s getting failed only when it is obtained from that workflow with OUT argument in invoke workflow file activity

It looks good with the argument assignment kindly check whether the writeline activity with statement has the variable (which we assigned as a value to out argument)

Cheers @Latif

I did checked many time and then have changed variable type in both sequence from string to Generic Value as can have - value too…
but when i import the argument and assigning value to the variable in other flow its not working.

image

check its not showing any thing :frowning:

please help palaniyappan …

1 Like

can someone help on this issue?

@Latif

Could you share your code? By your images I couldn’t see the problem

1 Like