Skip to content

Instantly share code, notes, and snippets.

@tecnocrata
Created June 6, 2014 14:09
Show Gist options
  • Select an option

  • Save tecnocrata/ada047d78d36df4eebda to your computer and use it in GitHub Desktop.

Select an option

Save tecnocrata/ada047d78d36df4eebda to your computer and use it in GitHub Desktop.
Solving PriorityManagement-by-RoutingMode>1:XXX>2:YYY regex
//PriorityManagement-by-RoutingMode>1:XXX>2:YYY
private string ResolveNamePattern(string name)
{
var globalpattern = "(?<PName>.*)-by-(?<Criteria>.*)-(?<Conditions>>.*)";
if (!Regex.IsMatch(name, globalpattern, RegexOptions.IgnoreCase)) return name;
var globalregex = new Regex(globalpattern, RegexOptions.IgnoreCase);
var parameterName = globalregex.Match(name).Groups["PName"].Value;
var criteria = globalregex.Match(name).Groups["Criteria"].Value;
var conditions = globalregex.Match(name).Groups["Conditions"].Value;
return EvaluateConditions(parameterName, criteria, conditions);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment