How Can I use Argument or Variable in RegEx Builder Value field?

Is it possible to use an Argument for the RegEx Builder’s Value parameter?
I need to pass the RegEx pattern match into the workflow, using a workflow argument.

I am unable to determine how to use a variable or argument for the Value field.

1 Like

Hey @grosner

You can save this & replace it with variable in the activity property panel.

Hope that helps.


try like this String.Format in assign activity, may work , this will give you a regexcollection;
System.Text.RegularExpressions.Match(strInput,String.Format("{0}\s+{1} \d",input,sym)+"{1,3}.+\n")

Can you provide more details? What is the variable type? String? Where exactly would the variable go? in The Value field? That did not work for me.

Are you suggesting that I use the Assign activity instead of the Replace activity?
My question is actually about the Replace activity, and how to use a variable for the Value property.

yup , I am suggesting to use the assign one , or you can even try the string.format in the regex activity properties pannel if it works , (I am not sure hope it works!!)

Surrounding variable name with curly braces appears to work.

This is what it looks like:

Additional Information:

  • The variable is of type String.
  • You can start typing the variable name and see a pop-up list of variable suggestions by first pressing the space bar.

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