Question: Any help would be much appreciated on figuring out how to identify Acronyms within a text field that has mixed upper and lower case letters.  

For example, we might have 
"*we used the BBQ sauce on the Chicken*"
I need my query to SELECT "BBQ" and nothing else in the cell.
There could be multiple capitalized string per row
The output should include the uppcase string.

Any ideas are much appreciated!!

Answer: 
Defining acronyms as all uppercase words with 2 to 5 characters with a `'\b[A-Z]{2,5}\b'` regex:

```
WITH cte AS
 ( -- using @Andrew's Volatile Table 
   SELECT * 
   FROM vt
   -- only rows containing acronyms
   WHERE RegExp_Similar(col1, '.*\b[A-Z]{2,5}\b.*') = 1 
 )
SELECT
   outkey,
   tokenNum,
   CAST(RegExp_Substr(Token, '[A-Z]*') AS VARCHAR(5)) AS acronym -- 1st uppercase word 
   --,token
FROM TABLE
    ( RegExp_Split_To_Table
        ( cte.id,
          cte.col1,

             -- split before an acronym, might include additional characters after
             -- [^A-Z]*? = any number of non uppercase letters (removed)
             -- (?= ) = negative lookahead, i.e. check, but don't remove
          '[^A-Z]*?(?=\b[A-Z]{2,5}\b)',

          '' -- defaults to case sensitive
        ) RETURNS
            ( outKey INT,
              TokenNum INT,
              Token VARCHAR(30000) -- adjust to match the size of your input column 
            )
    ) AS t
WHERE acronym <> ''

```
I am not 100% sure what are you trying to do but I thing you have many options. I.e.:

**Option 1)** check if the acronym (like BBQ) exist in the string (basic syntax)

```
SELECT CHARINDEX ('BBQ',@string)

```

In this case you would need a table of all know acronyms you want to check for and then loop through each of them to see if there is a match for your string and then return the acronym.

```
DECLARE @string VARCHAR(100)
SET @string = 'we used the BBQ sauce on the Chicken'

create table : [acrs]
--+--- acronym-----+
--+    BBQ         +
--+    IBM         +
--+    AMD         +
--+    ETC         +
--+----------------+

SELECT acronym FROM [acrs] WHERE CHARINDEX ([acronym], @string ) > 0)

```

This should return : 'BBQ'

**Option 2)** load up all the upper case characters into a temp table etc. for further logic and processing. I think you could use something like this...

```
DECLARE @string VARCHAR(100)
SET @string = 'we used the BBQ sauce on the Chicken'

-- make table of all Upper case letters and process individually
;WITH cte_loop(position, acrn)
 AS (
        SELECT 1, SUBSTRING(@string, 1, 1)
        UNION ALL
        SELECT position + 1, SUBSTRING(@string, position + 1, 1)
        FROM cte_loop
        WHERE position < LEN(@string) 
 )
SELECT position, acrn, ascii(acrn) AS [ascii]
FROM cte_loop
WHERE ascii(acrn) > 64 AND ascii(acrn) < 91 -- see the ASCII table for all codes

```

**This would return table like this:**

[![enter image description here](https://i.stack.imgur.com/cucoy.png)](https://i.stack.imgur.com/cucoy.png)