Using RegEx in SSIS

regex, ssis

Solution

At the core of the logic, you would use a Script Transformation as that's the only place you can access the regex.

You could simply a second column to your data flow, `IDCleaned` and that column would only contain cleaned values or a NULL. You could then use the Conditional Split to filter good rows vs bad. System.Text.RegularExpressions.Regex.Replace error in C# for SSIS

If you don't want to add another column, you can set your current ID column to be ReadWrite for the Script and then update in place. Perhaps adding a boolean column might make the Conditional Split logic easier at this point.

Problem

I currently have a package pulling data from an excel file, but when pulling the data out I get rows I do not want. So I need to extract everything from the 'ID' field that has any sort of letter in it. I need to be able to run a `RegEx` command such as `"%[a-zA-Z]%"` to pull out that data. But with the current limitation of `conditional split` it's not letting me do that. Any ideas on how this can be done?

Original source