System.Text.RegularExpressions.RegexFCD.AnchorDescription C# (CSharp) Method

AnchorDescription() static private method

static private AnchorDescription ( int anchors ) : string
anchors int
return string
        internal static string AnchorDescription(int anchors)
        {
            StringBuilder sb = new StringBuilder();

            if (0 != (anchors & Beginning)) sb.Append(", Beginning");
            if (0 != (anchors & Start)) sb.Append(", Start");
            if (0 != (anchors & Bol)) sb.Append(", Bol");
            if (0 != (anchors & Boundary)) sb.Append(", Boundary");
            if (0 != (anchors & ECMABoundary)) sb.Append(", ECMABoundary");
            if (0 != (anchors & Eol)) sb.Append(", Eol");
            if (0 != (anchors & End)) sb.Append(", End");
            if (0 != (anchors & EndZ)) sb.Append(", EndZ");

            if (sb.Length >= 2)
                return (sb.ToString(2, sb.Length - 2));

            return "None";
        }

Usage Example

        internal void Dump()
        {
            int i;

            Debug.WriteLine("Direction:  " + (_rightToLeft ? "right-to-left" : "left-to-right"));
            Debug.WriteLine("Firstchars: " + (_fcPrefix == null ? "n/a" : RegexCharClass.SetDescription(_fcPrefix.Prefix)));
            Debug.WriteLine("Prefix:     " + (_bmPrefix == null ? "n/a" : Regex.Escape(_bmPrefix.ToString())));
            Debug.WriteLine("Anchors:    " + RegexFCD.AnchorDescription(_anchors));
            Debug.WriteLine("Scanchars:  " + (_scPrefix == null ? "n/a" : RegexCharClass.SetDescription(_scPrefix.Prefix)));
            Debug.WriteLine("");

            /*
             * if (_bmPrefix != null) {
             *  Debug.WriteLine("BoyerMoore:");
             *  Debug.WriteLine(_bmPrefix.Dump("    "));
             * }
             */
            for (i = 0; i < _codes.Length;)
            {
                Debug.WriteLine(OpcodeDescription(i));
                i += OpcodeSize(_codes[i]);
            }

            Debug.WriteLine("");
        }
All Usage Examples Of System.Text.RegularExpressions.RegexFCD::AnchorDescription