I need to use a regular expression which returns the time of format 12:43 AND 1:33, I tried the following, and each one returns the desired results, how can I combine both so SQL can return either the first OR the second :
set @reg = '[0-9]:[0-5][0-9]'
set @reg = '[0-1][0-2]:[0-5][0-9]'
What I have tried:
Declare @reg nvarchar(100)
set @reg = '[0-9]:[0-5][0-9]'
--set @reg = '[0-1][0-2]:[0-5][0-9]'
select remarks,
substring(remarks,PATINDEX('%' + @reg + '%',remarks) ,5), len(PATINDEX('%' + @reg + '%',remarks))
from infraction
where remarks like '%' + @reg + '%'