mdq.RegexIsMatch (Transact-SQL)

Indicates whether the regular expression finds a match in the input string by using the regular expression that is specified in the pattern parameter. This function uses the regular expression functionality of the IsMatch method in the Microsoft .NET Framework. mdq.RegexIsMatch is in the mdq schema and is available only in the Master Data Services database.

Topic link iconTransact-SQL Syntax Conventions

Syntax

mdq.RegexIsMatch (input,pattern,mask)

Arguments

  • input
    Is the input string for which to find a match. input is nvarchar(4000) with no default.

  • pattern
    Is the regular expression pattern to use for matching. pattern is nvarchar(4000) with no default.

  • mask
    Is the RegexOptions mask that specifies the behavior of the regular expression. For more information, see mdq.RegexMask (Transact-SQL).

Return Code Values

bit

Remarks

Returns 1 if the match is found, and 0 if no match is found.

Permissions

Requires membership in the public role.

Examples

The following example checks whether the input string matches the specified regular expression pattern.

USE MDM_Sample;
GO

SELECT mdq.RegexIsMatch( N'123-451-6789', N'^\d{3}-\d{3}-\d{4}$', 0);

See Also

Reference

Master Data Services Functions (Transact-SQL)

Concepts

Master Data Services

Other Resources

System.Text.RegularExpressions Namespace