Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var minPos = 500;
- foreach (var rule in TireBrand.RulesToApply)
- {
- if (rule.Definition == null)
- {
- continue;
- }
- var m = Regex.Match(
- TireBrand.ValueBefore,
- @rule.Definition,
- RegexOptions.IgnoreCase);
- var matchfound = m.Success;
- if (matchfound)
- {
- if (TireBrand.ValueBefore.ToUpper().IndexOf(m.Groups[0].Value.ToUpper()) < minPos)
- {
- result =
- (rule.DefaultMatchValue != null ?
- rule.DefaultMatchValue :
- m.Groups[0].Value);
- minPos = TireBrand.ValueBefore.ToUpper().IndexOf(m.Groups[0].Value.ToUpper());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement