search a string that contain 6 or 7 characters but no spaces

  • Thanks....I was puzzled why you introduced underscores into the mix. Would [a-z0-9] not be more appropriate (more restrictive) e.g. wouldn't allow funny characters.

  • David McKinney (7/6/2012)


    Thanks....I was puzzled why you introduced underscores into the mix. Would [a-z0-9] not be more appropriate (more restrictive) e.g. wouldn't allow funny characters.

    Yes, laziness from me 😉

    Technically, it should probably be like this: -

    WHERE fixedPcode LIKE '[A-Z][A-Z0-9][0-9][ABD-HJLNP-UW-Z][ABD-HJLNP-UW-Z]'

    OR fixedPcode LIKE '[A-Z][A-Z0-9][A-Z0-9][0-9][ABD-HJLNP-UW-Z][ABD-HJLNP-UW-Z]'

    OR fixedPcode LIKE '[A-Z][A-Z0-9][A-Z0-9][A-Z0-9][0-9][ABD-HJLNP-UW-Z][ABD-HJLNP-UW-Z]'


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Viewing 2 posts - 16 through 16 (of 16 total)

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