0

I'm using WF BRE and try to use regex in rule condition. But there is no regex. The namespace System.Text.RegularExpressions does not exist, neither the Regex.Match method. I tried to add:

using System.Text.RegularExpressions;

to my Rules Designer Application but that didn't work.

I get the "Rule Set Editor: Error parsing the Action(s): The identifier "Regex" could not be resolved." error.

How can I add regex to BRE?

JKL
  • 21
  • 8
  • @stribizhev Reference to System is added. I can't add reference to System.Text or System.Text.RegularExpressions. – JKL Jul 15 '15 at 09:56
  • @stribizhev as I wrote before, there is reference to System. You can't add there reference to System.Text or anything below that. – JKL Jul 15 '15 at 10:53

1 Answers1

0

If anyone has the same issue. This is how I resolved it.

Created a method on class that entere the flow

public bool CheckPattern(string pattern, string value)
    {
        Regex regex = new Regex(pattern);

        return regex.IsMatch(value);
    }

And in Rule entered:

this.CheckPattern("myRegexPattern", myEmail)
JKL
  • 21
  • 8