Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8345775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:47:31+00:00 2026-06-09T06:47:31+00:00

Given a sql query with some columns that have upper case letters, how can

  • 0

Given a sql query with some columns that have upper case letters, how can I search for words that contain a upper case letter but not SQL keywords, for example:

SELECT ... ,
    table1.thisColumn AS column,
    ...
    FROM table1

I’ve tried without success to build something like this:

(?!AS+FROM+LEFT+JOIN+ON)[A-Z]{2,}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:47:33+00:00Added an answer on June 9, 2026 at 6:47 am

    Two things to note about your existing regex.

    1. The “or” operator in the exception-list should be a | and not a +. The + will be treated as an actual character whereas the | will tell the regex engine “left” or “right”, as you want in this case.
    2. To match a full-word that contains at least one upper-case letter, you actually need to check for the lower-case letters as well – but “require” at least one upper-case letter.

    I’ve come up with the following:

    (?:^|\.|[\t ])(?!AS|FROM|LEFT|JOIN|ON)([a-z0-9]*[A-Z][a-zA-Z0-9]+)
    

    I tested this against your sample query and also added other random SQL to it (such as an expanded field list, WHERE clause, etc.). It successfully found each word that contained at least one capital letter and was not in the list of keywords to ignore.

    If you’re using this to just “search” via Find Next or Find All in Opened|Current Documents, it will highlight the matching word and a preceding . or whitespace character(s).

    If you’re using this to “replace”, the matched word (without the preceding . or whitespace character(s)) can be used/accessed via the \1 match.

    Regex Explained:

    (?:                         # non-matching group;
                                # a "word" is required to be preceeded by one of the following
        ^                       # beginning of line
        |\.                     # period
        |[\t ]                  # tab or space;
                                # note: we don't use the \s here because a newline will break notepadd++'s "find all" feature
    )
    
    (?!AS|FROM|LEFT|JOIN|ON)    # list of words to ignore
    
    (                           # group to match
        [a-z0-9]*               # word can start with lowercase a-z or 0-9
        [A-Z]                   # required uppercase letter
        [a-zA-Z0-9]+            # word can end with lowercase/uppercase a-z or 0-9
    )
    

    You’ll also want to add in any missing SQL keywords (if needed), or other allowed characters in the “words can have these characters” list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of words that I want to exclude from some query
Given SQL as an input, I have to query a PostgreSQL database and return
I have the following SQL query I was given, but I am not sure
I have problem with SQL query. If given order contains items, witch does not
I have a big fat query that's written dynamically to integrate some data. Basically
I've two tables which have following columns: Now I want have a SQL query
Hoping I can get some architectural advice on this. I have been given the
I'm given an SQL query that change the database schema in a certain way.
I have some tables that contain data about players and the games they have
I have an update query that shouldbe working but for some reason it doesnt

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.