Regex expresion in MS SQL
- by adopilot
I do not not know much about Regex, I want to try parsing sting from database according to flowing instructions.
I know that I am need to use CLR but for begin I want to learn Regex
Data in tables look like
create table #tempTBL (opis varchar(40))
go
insert into #tempTBL
select 'C 136'
union
select 'C 145'
union
select 'C146'
union
select 'AK C 182'
union
select 'C 277'
union
select 'C-240'
union
select 'ISPRAVKA PO C 241'
And select sting looks like
Select
reverse(
rtrim(
ltrim(
replace(
(substring
(reverse(opis)
,0
,charindex(
'C',reverse(opis)
)
)
)
,'-',' ')
)
)
) as jci
from #tempTBL
How should looks like my C# code to I repeat this using regex