/// <summary> /// Tests whether the Actual string is matched by the given Regex /// </summary> /// <param name="matched">Continuation to operate on</param> /// <param name="regex">Regular expression which will be compiled into a Regex instance to match with</param> /// <returns>More continuation for Actual string</returns> public static IStringMore By( this IStringMatched matched, string regex ) { return(matched.By(regex, null)); }
/// <summary> /// Tests whether the Actual string is matched by the given Regex /// </summary> /// <param name="matched">Continuation to operate on</param> /// <param name="regex">Regex instance to match with</param> /// <returns>More continuation for Actual string</returns> public static IStringMore By( this IStringMatched matched, Regex regex ) { return(matched.By(regex, NULL_STRING)); }
/// <summary> /// Tests whether the Actual string is matched by the given Regex /// </summary> /// <param name="matched">Continuation to operate on</param> /// <param name="regex">Regular expression which will be compiled into a Regex instance to match with</param> /// <param name="customMessage">Custom message to add to failure messages</param> /// <returns>More continuation for Actual string</returns> public static IStringMore By( this IStringMatched matched, string regex, string customMessage ) { return(matched.By(CompileRegexFor(regex), customMessage)); }
/// <summary> /// Tests whether the Actual string is matched by the given Regex /// </summary> /// <param name="matched">Continuation to operate on</param> /// <param name="regex">Regex instance to match with</param> /// <param name="customMessage">Custom message to add to failure messages</param> /// <returns>More continuation for Actual string</returns> public static IStringMore By( this IStringMatched matched, Regex regex, string customMessage ) { return(matched.By(regex, () => customMessage)); }
/// <summary> /// Tests whether the Actual string is matched by the given Regex /// </summary> /// <param name="matched">Continuation to operate on</param> /// <param name="regex">Regex instance to match with</param> /// <param name="customMessageGenerator">Custom message to add to failure messages</param> /// <returns>More continuation for Actual string</returns> public static IStringMore By( this IStringMatched matched, Regex regex, Func <string> customMessageGenerator ) { AddRegexMatcher(matched, regex, customMessageGenerator); return(matched.More()); }