By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
select 2 as id, 'This value is Nov 20 2020 and will be Jan 20 2021' as text
into t union all
select 3 as id, 'This value is Sep 20 2020 and will be Oct 20 2020, Nov 20 2020'
2 rows affected
with cte as (
select id, convert(varchar(max), null) as dte, convert(varchar(max), text) as rest, 0 as lev
from t
union all
select id,
left(stuff(rest,
1,
patindex('%[A-Z][a-z][a-z] [0-9][0-9] [0-9][0-9][0-9][0-9]%', rest),
1), 11),
stuff(rest,
1,
patindex('%[A-Z][a-z][a-z] [0-9][0-9] [0-9][0-9][0-9][0-9]%', rest) + 11,
11),
lev + 1
from cte
where rest like '%[A-Z][a-z][a-z] [0-9][0-9] [0-9][0-9][0-9][0-9]%' and lev < 5
)
select id, dte
from cte
where lev > 0
id | dte |
---|---|
3 | 1ep 20 2020 |
3 | 1ct 20 2020 |
3 | 1ov 20 2020 |
2 | 1ov 20 2020 |
2 | 1an 20 2021 |