Ok i know that in vb i can just at a reference but this isn't in vb6 it's in a different application that uses code similar to VBA. so i need to do some regular expression testing and i'm doing the following and if i use the following pattern
(?<!,)\d{12, 20}(?!,)
it throws an error, but if i use something like
\d{12, 20}
it works fine... so does VBScript.RegExp not support look-ahead, behind ect.
VB Code:
'======================================================================== 'Functionality to check if tracking, order, pick tkt numbers and division 'seem to be truely valid Dim regex As Object Set regex = CreateObject("VBScript.RegExp") regex.IgnoreCase = True 'Test OrderNo If Not IsNumeric(KfxOrderNo) Then bOrderNoValid = 0 Else 'Test expression regex.Pattern = "(?<!,)\d{12, 20}(?!,)" Dim xOrderNo As String xOrderNo = "tt123456789012tt" 'KfxOrderNo If Not regex.Test(xOrderNo) Then msgbox "shouldn't be here" bOrderNoValid = 0 End If End If



Reply With Quote