SPUtility.IsValidStringInput method

Determines whether the specified text is in a valid format as specified by a regular expression.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public static bool IsValidStringInput(
	string regexp,
	string newValue


Type: System.String

The regular expression specifying the valid format.

Type: System.String

The text to validate.

Return value

Type: System.Boolean
Returns true if the text is in the specified format; otherwise, false.

This method determines whether the value of the newValue parameter matches the regular expression in the regexp parameter.