• Api Documentation
Show / Hide Table of Contents
  • Ubiquity.NET.ArgValidators
    • ValidatedNotNullAttribute
    • Validators
      • ValidateDefined
      • ValidateLength
      • ValidateNotDefault
      • ValidateNotNull
      • ValidateNotNullOrWhiteSpace
      • ValidatePattern
      • ValidateRange

Method ValidatePattern

 

ValidatePattern(String, String, String)

Verifies that a string matches a Regular expression pattern.

Declaration
public static Match ValidatePattern(this string value, string pattern, string paramName)

Parameters

System.String value

String value to validate.

System.String pattern

Pattern to use for testing value.

System.String paramName

Name of the parameter for the exception message if value does not match the pattern.

Returns

System.Text.RegularExpressions.Match

System.Text.RegularExpressions.Match from a successful pattern match.

 

ValidatePattern(String, Regex, String)

Verifies that a string matches a Regular expression pattern.

Declaration
public static Match ValidatePattern(this string value, Regex pattern, string paramName)

Parameters

System.String value

String value to validate.

System.Text.RegularExpressions.Regex pattern

Pattern to use for testing value.

System.String paramName

Name of the parameter for the exception message if value does not match the pattern.

Returns

System.Text.RegularExpressions.Match

System.Text.RegularExpressions.Match from a successful pattern match.

Back to top Copyright (C) 2017-2021, Ubiquity.NET Contributors
Build: 7.0.0