Created
June 6, 2014 14:09
-
-
Save tecnocrata/ada047d78d36df4eebda to your computer and use it in GitHub Desktop.
Solving PriorityManagement-by-RoutingMode>1:XXX>2:YYY regex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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