![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm still in learning mode with regular expressions and am attempting a few things during a Trasformation task from one table to another. Basically what I'm trying to to is this: during the copy/import from one table to another, I'm trying to somewhat validate an email field. When it returns valid I want it mapped directly to the corresponding column in the destination, but when it doesn't match to the expression, I want it moved to a different column. What I've got so far is this: Function Main() Dim objRE Dim strExample set objRE = new RegExp objRE.Pattern = "^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$" strExample = TRIM( DTSSource("CAP_EMAIL") ) ' Test if a match is found If objRE.Test(strExample) = True Then DTSDestination("CAP_EMAIL") = DTSSource("CAP_EMAIL") Else DTSDestination("invalidCapEmail") = DTSSource("CAP_EMAIL") End If Set objRE = Nothing Main = DTSTransformStat_OK End Function It keep returning the following error: ActiveX Scripting Transform '': Function 'reg' was not found in the script. Any help would be appreciated. |
#3
| |||
| |||
|
|
Are you sure the error is for the code you have posted? Code looks fine, and significantly does not appear to call any function called "reg". That's what is completely baffling to me. That's a copy and paste from |
#4
| |||
| |||
|
|
Darren Green wrote: Are you sure the error is for the code you have posted? Code looks fine, and significantly does not appear to call any function called "reg". That's what is completely baffling to me. That's a copy and paste from the activeX transformation. -Dan |
![]() |
| Thread Tools | |
| Display Modes | |
| |