[Cell Phone] like '%[^a-zA-Z0-9(+&]%')

  • I am wondering if someone can help me understand what this is in the query I am sharing below? 

    '%[^a-zA-Z0-9(+&]%')

    This is the 1st time I have seen it.

    P.S this is not a complete query, only part of it.
    Select d.UID from [FJMobileContactStaging]d
    where (substring(d.[Cell Phone],-1,3)<'2'
     or substring (d.[Cell Phone],4,1)<'2'
    or d.[Cell Phone]like'%22222222%'
    or d.[Cell Phone] like '%[^a-zA-Z0-9(+&]%')
    and len(d.[Cell Phone])<>4

  • NewBornDBA2017 - Thursday, April 5, 2018 8:56 AM

    I am wondering if someone can help me understand what this is in the query I am sharing below? 

    '%[^a-zA-Z0-9(+&]%')

    This is the 1st time I have seen it.

    P.S this is not a complete query, only part of it.
    Select d.UID from [FJMobileContactStaging]d
    where (substring(d.[Cell Phone],-1,3)<'2'
     or substring (d.[Cell Phone],4,1)<'2'
    or d.[Cell Phone]like'%22222222%'
    or d.[Cell Phone] like '%[^a-zA-Z0-9(+&]%')
    and len(d.[Cell Phone])<>4

    It's a Regular Expression (Regex).
    It means, show me any rows where [Cell Phone] contains characters other than a–z, A–Z, 0–9,(,+ or &

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Phil Parkin - Thursday, April 5, 2018 9:09 AM

    It's a Regular Expression (Regex).
    It means, show me any rows where [Cell Phone] contains characters other than a–z, A–Z, 0–9,(,+ or &

    Only because I've been pulled up on this before Phil, but it's not actually REGEX; it's doesn't have as much functionality as REGEX does. It is very similar in formatting, however, which is likely intentional. 🙂

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Thom A - Thursday, April 5, 2018 9:35 AM

    Phil Parkin - Thursday, April 5, 2018 9:09 AM

    It's a Regular Expression (Regex).
    It means, show me any rows where [Cell Phone] contains characters other than a–z, A–Z, 0–9,(,+ or &

    Only because I've been pulled up on this before Phil, but it's not actually REGEX; it's doesn't have as much functionality as REGEX does. It is very similar in formatting, however, which is likely intentional. 🙂

    Thanks Thom! I did actually debate putting "of sorts" after "Regular Expression", because I know it's not got all the functionality of an, err, regular Regular Expression ...
    Thinking on it some more, I still can't think of a good & snappy way of describing it. Cut-down Regex? Extended wildcard? Gandalf expression?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Phil Parkin - Thursday, April 5, 2018 10:34 AM

    Thanks Thom! I did actually debate putting "of sorts" after "Regular Expression", because I know it's not got all the functionality of an, err, regular Regular Expression ...
    Thinking on it some more, I still can't think of a good & snappy way of describing it. Cut-down Regex? Extended wildcard? Gandalf expression?

    oh, I lik

    Oh, I like Gandalf. :p

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply