As far as I found out, T-SQL has a possibility to check for regular expressions, via PATINDEX.
My task is simple: I get a telecom-Type (phone for example). On a mapping table, a regex to validate this type is saved. So before saving, I'd like to check this regex.
So easy done:
-- Check the regular expression for phone
DECLARE @regExp nvarchar(255);
SELECT @regExp = tt.ValidationRegex
FROM Core.TelecomType tt
WHERE tt.Code = @DEFAULT_PHONE_TYPE;
Sadly, this always returns 0, even with wildcards with tries like this:
SET @regExp = CONCAT('%', @regExp, '%');
SET @regExp = CONCAT(@regExp, '%');
SET @regExp = CONCAT('%', @regExp );
On RegExr and oracle-side, the values seem to match, so is this a problem on the T-SQL? If yes, is there a workarround for this?
Thanks in advance
Matthias