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

Parse() static private method

static private Parse ( string re, RegexOptions op ) : RegexTree
re string
op RegexOptions
return RegexTree
        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 = p._capnamelist.ToArray();

            return new RegexTree(root, p._caps, p._capnumlist, p._captop, p._capnames, capnamelist, op);
        }