System.Text.RegularExpressions.RegexParser.Reset C# (CSharp) Method

Reset() private method

private Reset ( RegexOptions topopts ) : void
topopts RegexOptions
return void
        internal void Reset(RegexOptions topopts)
        {
            _currentPos = 0;
            _autocap = 1;
            _ignoreNextParen = false;

            if (_optionsStack.Count > 0)
                _optionsStack.RemoveRange(0, _optionsStack.Count - 1);

            _options = topopts;
            _stack = null;
        }

Usage Example

Beispiel #1
0
        // This static call constructs a RegexTree from a regular expression
        // pattern string and an option string.
        //
        // The method creates, drives, and drops a parser instance.
        internal static RegexTree Parse(String re, RegexOptions op) {
            RegexParser p;
            RegexNode root;
            String[] capnamelist;

            p = new RegexParser((op & RegexOptions.CultureInvariant) != 0 ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture);

            p._options = op;

            p.SetPattern(re);
            p.CountCaptures();
            p.Reset(op);
            root = p.ScanRegex();

            if (p._capnamelist == null)
                capnamelist = null;
            else
                capnamelist = (String[])p._capnamelist.ToArray(typeof(String));

            return new RegexTree(root, p._caps, p._capnumlist, p._captop, p._capnames, capnamelist, op);
        }
All Usage Examples Of System.Text.RegularExpressions.RegexParser::Reset