public RegexEngine(Regex regex, string input) { _input = input; // Every time GetParseSteps() is called, the Regex gets a new IRegexEngine. _getParseSteps = () => regex.Parse(new RegexEngineInternal(input)); }
internal static ParseStep Match(Regex regex, State initialState, string matchedText, IList<IList<ParenCapture>> captures) { return new ParseStep { Type = ParseStepType.Match, Node = regex, MatchedText = matchedText, InitialState = initialState, Captures = captures }.WithMessage(step => regex.GetPassMessage(step.MatchedText, step.InitialState)); }