Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
getanothername
Starting Member
4 Posts |
Posted - 2005-04-13 : 18:23:04
|
| 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 objREDim strExampleset objRE = new RegExpobjRE.Pattern = "^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$"strExample = TRIM( DTSSource("CAP_EMAIL") )' Test if a match is foundIf objRE.Test(strExample) = True Then DTSDestination("CAP_EMAIL") = DTSSource("CAP_EMAIL")Else DTSDestination("invalidCapEmail") = DTSSource("CAP_EMAIL")End IfSet objRE = Nothing Main = DTSTransformStat_OKEnd FunctionIt keep returning the following error: ActiveX Scripting Transform '<DTS Testing Transformation>': Function 'reg' was not found in the script.Any help would be appreciated.-Dan |
|
|
|
|
|