SQL Server 2025 (public preview) introduces native regular expression (regex) functions in T-SQL: REGEXP_LIKE
, REGEXP_REPLACE
, and REGEXP_SUBSTR
. Since AnalyticsCreator generates standard T-SQL scripts for transformations, these functions work transparently—define a column expression with a regex function, compile to your target database, and run.
REGEXP_LIKE(string, pattern [, flags])
— Boolean match testREGEXP_REPLACE(string, pattern [, replacement [, start [, occurrence [, flags]]]]])
— Replace matchesREGEXP_SUBSTR(string, pattern [, start [, occurrence [, flags [, group]]]]])
— Extract substringsSupported flags:
i
— Case-insensitivem
— Multi-line modes
— Dot matches newlinec
— Case-sensitive (default)AnalyticsCreator compiles calculated columns, manual SQL, and scripted transformations to native SQL. On SQL Server 2025 or compatible Azure SQL previews, regex works immediately—no special configuration needed.
Example use cases:
REGEXP_LIKE
-- Remove dashes from ProductNumber
REGEXP_REPLACE([T1].[ProductNumber], '-', '')
Steps in AnalyticsCreator:
SELECT EmailAddress
FROM SalesLT.Customer
WHERE NOT REGEXP_LIKE(
EmailAddress,
'^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$',
'i'
);
SELECT ProductNumber,
REGEXP_SUBSTR(ProductNumber, '[0-9]+') AS FirstNumberToken
FROM SalesLT.Product;
SELECT AddressLine1,
REGEXP_REPLACE(AddressLine1, '\s+', ' ', 1, 0, 'm') AS AddressLine1Normalized
FROM SalesLT.Address;
-- Case-insensitive
SELECT Name AS CategoryName
FROM SalesLT.ProductCategory
WHERE REGEXP_LIKE(Name, '^hardware$', 'i');
-- Case-sensitive
SELECT Name AS CategoryName
FROM SalesLT.ProductCategory
WHERE REGEXP_LIKE(Name, '^Hardware$', 'c');
SELECT ProductNumber,
REGEXP_REPLACE(ProductNumber, '-', '/', 1, 2) AS ReplaceSecondDash
FROM SalesLT.Product;
SELECT ProductNumber,
REGEXP_SUBSTR(ProductNumber, '^([A-Z0-9]+)-([A-Z0-9]+)-([A-Z0-9]+)', 1, 1, '', 2) AS ColorToken
FROM SalesLT.Product;
i
for case-insensitive mode.LIKE
or PATINDEX
for simple patterns.Native regex support in SQL Server 2025 enables AnalyticsCreator users to integrate powerful pattern matching, cleansing, and parsing directly into transformation pipelines—without additional setup. This opens new opportunities for data quality enforcement and feature extraction directly in the data warehouse layer.