Open jeme opened 8 years ago
500ms is parsed as minutes, should use lookaheads:
private static readonly Regex timeSpanExpression = new Regex(@"((?'d'[0-9]+)\s?d(ay(s)?)?)?\s?" + @"((?'h'[0-9]+)\s?h(our(s)?)?)?\s?" + @"((?'m'[0-9]+)\s?m(?![is])(in(ute(s)?)?)?)?\s?" + @"((?'s'[0-9]+)\s?s(ec(ond(s)?)?)?)?\s?" + @"((?'f'[0-9]+)\s?(f(rac(tion(s)?)?)?)?|(ms)|(millisecond(s)?))?", RegexOptions.Compiled | RegexOptions.IgnoreCase);
Switch to use: https://github.com/dotJEM/adv-parsers
500ms is parsed as minutes, should use lookaheads: