I'm currently working with parsing some data from SQL Server and I'm in need of help with a Regex.
I have an assembly in Sql Server 2005 that helps me Replace strings using C# Regex.Replace() Method.
I need to parse the following.
Strings:
CAD 90890
(CAD 90892)
CAD G67859
CAD 34G56
CAD 3S56.
AX CAD 890990
CAD 783783 MX
Needed Results:
90890
90892
G67859
34G56
3S56
890990
783783
SELECT TOP 25 CADCODE, dbo.RegExReplace(CADCODE, '*pattern*', '$1')
FROM dbo.CADCODES
WHERE CADCODE LIKE '%CAD%'
I need to get the proceeding string after the CAD word until it hits a white-space or anything that not a number or digit. I managed to get the digits but it really fails on others. I'm trying to get it to work but I can't find a real solution.
Thanks in advance.
Updated to reflect new Strings
AX CAD 890990
CAD 783783 MX