dotJEM / json-index

MIT License
7 stars 3 forks source link

AdvConvert does not convert TS corectly. #8

Open jeme opened 8 years ago

jeme commented 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);
jeme commented 7 years ago

Switch to use: https://github.com/dotJEM/adv-parsers