Available in...
Big Data Platform
Cloud API Services Platform
Cloud Big Data Platform
Cloud Data Fabric
Cloud Data Management Platform
Data Fabric
Data Management Platform
Data Services Platform
MDM Platform
Real-Time Big Data Platform
Before you begin
- You have deployed the regular expression function to the SQL server.
- You have tested the regular expression.
- You have selected the Profiling perspective.
About this task
Here
is the code used in this example:
Using System;
Using Microsoft.SqlServer.Server;
Using System.Text.RegularExpressions;
Public partial class RegExBase
{
[SqlFunction(IsDeterministic = true, IsPrecise = true)]
Public static int RegExMatch( string matchString , string pattern)
{
Regex r1 = new Regex(pattern.TrimEnd(null));
if (r1.Match(matchString.TrimEnd(null)).Success == true)
{
return 1 ;
}
else
{
return 0 ;
}
Using
}
};
Procedure
Results
For more detailed information on how to declare a regular expression function in Talend Studio, see Defining a query template for a specific database and Declaring a User-Defined Function in a specific database.