I am trying to do a select with a regex. I have seen how to do this in where clauses on multiple posts but that is not what I want. What I want is to select a column, then apply a regex, then display it as something else (in this case timecodes).
I thought there was a regular expression function, but I only seem to find PATINDEX, which just tells me where the pattern starts. Is there a SQL function that I can use to apply a regex to something?
Something like:
SELECT PATINDEX('/^(\d{2})(\d{2})(\d{2})(\d{2})$/', TIMECODE) AS timecode
FROM INSTANCE
Except it returns the column with the regex applied
EDIT
Just so there is more clarity, I want to change how the data is returned. Say I have this time in millis: 1539885525171. I want to have that returned as the time 17:59:29.
I know this regex is not right, but for the sake of an example, I want to apply the expression '/^(\d{2})(\d{2})(\d{2})(\d{2})$/' to 1539885525171 so that it returns 17:59:29