Regular expression for CLR (C#) in SSIS

saravananravim

New member
Joined
Mar 27, 2018
Messages
1
Programming Experience
5-10
[FONT=&quot]Hi[/FONT]
[FONT=&quot][FONT=&quot]I have below Oracle regular expression that validates email-id. I need to convert this into its equivalent regex [/FONT]
[FONT=&quot]that I can use in CLR program in SSIS.[/FONT]

[FONT=&quot]/^(\s*[a-zA-Z0-9_\'-.])@([a-zA-Z0-9_-.]).([a-zA-Z]{2,5})$/[/FONT]

[FONT=&quot]Can someone pls help me convert?[/FONT]

[FONT=&quot]In plain english below is the rule:[/FONT]

[FONT=&quot]1.An email should start with any non-white space character[/FONT]

[FONT=&quot]2. Preceding with zero or more characters from the list of: a-z A-Z 0-9 - _ ' .[/FONT]

[FONT=&quot]3. @(at symbol)[/FONT]

[FONT=&quot]4. Any character from the list of: a-z A-Z 0-9 - _ .[/FONT]

[FONT=&quot]5. .(dot symbol)[/FONT]

[FONT=&quot]6. Any character from the list of: a-z A-Z between the size of 2 to 5 characters.[/FONT][/FONT]
 
[FONT="]Hi[/FONT][/COLOR]
[COLOR=#666666][FONT="][FONT="]I have below Oracle regular expression that validates email-id. I need to convert this into its equivalent regex [/FONT][/COLOR]
[COLOR=#404040][FONT="]that I can use in CLR program in SSIS.[/FONT]


[FONT="]/^(\s*[a-zA-Z0-9_\'-.])@([a-zA-Z0-9_-.]).([a-zA-Z]{2,5})$/[/FONT][/COLOR]

[COLOR=#404040][FONT="]Can someone pls help me convert?[/FONT]


[FONT="]In plain english below is the rule:[/FONT][/COLOR]

[COLOR=#404040][FONT="]1.An email should start with any non-white space character[/FONT]


[FONT="]2. Preceding with zero or more characters from the list of: a-z A-Z 0-9 - _ ' .[/FONT][/COLOR]

[COLOR=#404040][FONT="]3. @(at symbol)[/FONT]


[FONT="]4. Any character from the list of: a-z A-Z 0-9 - _ .[/FONT][/COLOR]

[COLOR=#404040][FONT="]5. .(dot symbol)[/FONT]


[FONT="]6. Any character from the list of: a-z A-Z between the size of 2 to 5 characters.[/FONT][/FONT]
Well in SSIS directly you can use a Script Task to run any C# or VB code you want like a regular program, you can even pass in variables from the package to use (and set for further use).
Or if you need to use .net Regex in Sql queries you can make CLR functions for use in Sql Server: Create CLR Functions | Microsoft Docs
 

Latest posts

Back
Top Bottom