SQL Server RegExp  

Posted in ,


sp_dbcmptlevel db_name, 90
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
EXEC sp_configure 'show advanced options' , '1';
go



public static partial class UserDefinedFunctions
{
public static readonly RegexOptions Options =
RegexOptions.IgnorePatternWhitespace |
RegexOptions.Singleline;

[SqlFunction]
public static SqlString RegexMatch(SqlChars input, SqlString pattern)
{
Regex regex = new Regex(pattern.Value, Options);
string data = new string(input.Value);
data.ToLower();
Match aMatch = regex.Match(data);
return aMatch.ToString();
}
};



select dbo.RegexMatch( N'123-45-6789', N'\d{2}' )

http://msdn.microsoft.com/en-us/magazine/cc163473.aspx

::[win.mac.lin]::  

Posted


snapshot of life and work...

 

Posted

At last week i saw a fun virus...
It's draw some chineese text on screen and quote from the bible...
By KAV (Kaspersky) it identified as Trojan.Win32.Agent.wj.

Infected files: mslogon.exe and systemnt.exe.



 

Posted

I'm here again.

now i want to say a bit about M$ genuine advantage.
Microsoft start OGA (Office genuine Advantage)... Half year latter, then WGA (Windows GA)...
But you still can download and install updates and software from microsoft cite.
After the xGA programs started on tech forums starts discussion about methods to bypass GA checking... About a week and cracks are online. Next some weeks cracks and cracked files were deleted from most hostings. But now you can find files and instructions about bypass checking valid.
And what microsoft want ?
M$ makes me LOL.

::[ibook]::  

Posted


I'm love apple and MacOSX...
But when i buy my ibook g4 (not new) i buy many troubles.
MacOSX crashes and did'n want to boot...
It was troubles with battary and CPU.
ibook stops or crash when CPU clock changing.
After some tweaks and reassembling all become stable.
it was half year ago...

::Vista::  

Posted

This is final (corporate edition) of Vista, i installed on one of notebooks at my work.
Many peoples don't want listen anything about new OS from Microsoft.
But i want say - vista is really better. It's different os.
I saw beta5... And now i see this release. A lot of work done.
Microsoft take security ideas from OpenBSD and Solaris and interface features from MacOSX...
Heh... Interface i see. What with Vista security and stability - good question.
Hard discussion started around it.

p.s. Vista runs fast with aero on CoreDuo 1.6 512mb RAM and i950 video.

metanews


Add to Google