clr sql server function

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



This is my function:

<Microsoft.SqlServer.Server.SqlFunction()> _
Public Shared Function RegExMatch(ByVal pattern As String, _
ByVal matchString As String) As Boolean

Dim r1 As Regex = New Regex(pattern.TrimEnd(Nothing),
RegexOptions.Compiled)
Return r1.Match(matchString).Success
End Function


I have noticed that the call:

select dbo.RegexMatch('some_reg_exp_pattern', my_match_content)

will trim my_match_content to 4000 chars.
It means everything over 4000 chars will be ignored. I guess this is
happening because of mapping string to a varchar - which may have a
max 4000 chars.

And my_match_content is actually a column varchar(max).

How can I adapt the function to support biger size strings?
Thanks,
xke

.



Relevant Pages

  • Re: Regex references
    ... Dim FirstName As String ... Groups in the Regex. ... Hard work is a medication for which ...
    (microsoft.public.dotnet.general)
  • Re: Static Class Constants (VB 2005)
    ... dim basechannel as somechannel ' SomeChannel is an object that is created ... for each s as string in LegacyInterface.GetData(, ... Public Sub New ... Private Function fetch(ByVal start As Integer, ByVal chars As Integer) As ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Evaluate Custom Expression
    ... I would use tokens, regex, the replace statement and then the instr ... Logic would look like (I am not well versed in regex, ... Function Getformula(StringInput As String) As String ... Dim sWhereClause As String, arrTokensAs String, i As Integer ...
    (microsoft.public.office.developer.vba)
  • Put# and unwanted characters
    ... I am using Random Access file routine to put records to a file, ... all chars < 33 and any & but this did not yield any of these chars, ... Private Function SaveExportAs String) As Boolean ... Dim iRecordCount As Integer ...
    (microsoft.public.vb.general.discussion)
  • Re: regex pro
    ... Dim teststring1 As String = ... Dim start As Integer = Environment.TickCount ... Dim teststring2 As String ... Dim regex As New ...
    (microsoft.public.dotnet.languages.vb)