YuriyGuts.RegexBuilder.RegexNodeLookAround.ToRegexPattern C# (CSharp) Method

ToRegexPattern() public method

public ToRegexPattern ( ) : string
return string
        public override string ToRegexPattern()
        {
            string format = string.Empty;
            switch (LookAroundType)
            {
                case RegexLookAround.PositiveLookAhead:
                    format = "(?:{1}(?={0}))";
                    break;
                case RegexLookAround.PositiveLookBehind:
                    format = "(?:(?<={0}){1})";
                    break;
                case RegexLookAround.NegativeLookAhead:
                    format = "(?:{1}(?!{0}))";
                    break;
                case RegexLookAround.NegativeLookBehind:
                    format = "(?:(?<!{0}){1})";
                    break;
            }

            string result = string.Format(CultureInfo.InvariantCulture, format, LookAroundExpression.ToRegexPattern(), MatchExpression.ToRegexPattern());
            if (HasQuantifier)
            {
                result += Quantifier.ToRegexPattern();
            }

            return result;
        }