#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2018
    Posts
    3
    Rep Power
    0

    Regular expression for CLR in SSIS


    I have below Oracle regular expression that validates email-id. I need to convert this into its equivalent regex
    that I can use in CLR program in SSIS.

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

    Can someone pls help me convert?

    In plain english below is the rule:

    1.An email should start with any non-white space character

    2. Preceding with zero or more characters from the list of: a-z A-Z 0-9 - _ ' .

    3. @(at symbol)

    4. Any character from the list of: a-z A-Z 0-9 - _ .

    5. .(dot symbol)

    6. Any character from the list of: a-z A-Z between the size of 2 to 5 characters.
  2. #2
  3. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,796
    Rep Power
    9646
    Pretty sure SSIS uses .NET regular expressions. The one you have there is compatible, but I think you have to drop the delimiters.

    But it's flawed. This one isn't.
    Code:
    /^(\s*[a-zA-Z0-9_\'.-])@([a-zA-Z0-9_.-]).([a-zA-Z]{2,5})$/
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2018
    Posts
    3
    Rep Power
    0
    Originally Posted by requinix
    Pretty sure SSIS uses .NET regular expressions. The one you have there is compatible, but I think you have to drop the delimiters.

    But it's flawed. This one isn't.
    Code:
    /^(\s*[a-zA-Z0-9_\'.-])@([a-zA-Z0-9_.-]).([a-zA-Z]{2,5})$/
    Delimiter you mean is the single quote?
  6. #4
  7. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,796
    Rep Power
    9646
    No, delimiters are used (sometimes depending on the language/engine) around the regex to separate it from any regex flags, like case-insensitivity. The delimiters here are the slashes. The escaped quote is presumably because it was in a string.

IMN logo majestic logo threadwatch logo seochat tools logo