[Question]
  [
This is similar to [Making an acronym](https://codegolf.stackexchange.com/questions/75448/making-an-acronym), but there are several key differences, including the method of fetching the acronym, and this challenge including flexible output.
## Task
Given a string (list of chars/length 1 strings is allowed) containing only printable ASCII, output all capital letters in the input that are either preceded by a space or a dash, or are the first character in the input. Empty string is undefined behavior.
## Test Cases:
Output may be in the format of `"TEST"`, `["T","E","S","T"]`, or whatever else works for you.
```
Self-contained Underwater Breathing Apparatus
SUBA
a Programming Language
PL
NATO Atlantic TREATY Organization
NATO
DEFCON 2
D
hello, world!
light-Emitting dioDe
E
What Does the Fox Say?
WDFS
3D mov-Ies
I
laugh-Out Lou-D
OLD
Best friends FOREVE-r
BF
--
<space>
--  --a -  - --
--  -- -  - -- A
A
Step-Hen@Gmail-Mail Mail.CoM m
SHMM
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest answer in bytes wins.
  
[Answer]
# [V](https://github.com/DJMcMayhem/V), 7 bytes
```
ÍÕü¼À!õ
```
[Try it online!](https://tio.run/##NYwxTsNAFET7PcWkZxs4AHKwLSFFMUoMiPIr/tldab0brb8ToOIClByFLhV7MBNL0MybN8Ucpyl/5q98/jnnj0X@nqYt@73exSDkAnd4DB2nEwknLBOTWBcMisOBEsk4KMJDiiZR38/7ioIZybBaF22DQjwFcTu0m6poX9AkQ8G9k7gYVFnVd80a18qy9/EKp5h8t1DeGSu66p3IfNi5WLJ6tiQoIw8Qy6jjK7b0dqtuSvTxqO95UJ5GY3UzClZx1KVa8iDYJ8ehG1A3m@qp0klprXAJQGvCjEv5839F8Qs "V – Try It Online")
Here is a hexdump to prove the byte count:
```
00000000: cdd5 fcbc c021 f5                        .....!.
```
Explanation:
```
Í       " Search and replace all occurrences on all lines:
        " (Search for)
 Õ      "   A non-uppercase letter [^A-Z]
  ü     "   OR
      õ "   An uppercase letter
    À!  "   Not preceded by...
   ¼    "   A word-boundary
        " (implicitly) And replace it with:
        "   Nothing
```
This is short all thanks to V's wonderful [regex compression](https://github.com/DJMcMayhem/V/wiki/Regexes).
[Answer]
# [R](https://www.r-project.org/), ~~66~~ 63 bytes
```
function(s)(s=substr(strsplit(s,' |-')[[1]],1,1))[s%in%LETTERS]
```
[Try it online!](https://tio.run/##PY7BasMwEER/ZS/BNliHtOdQnFqBQoiL7baUkMPWlmWBLBlp1TSl/@7Kh/aw7OybZRi3DLtlCKYjZU3qs9TvfPjw5NI4ftaKUp8n8MOS7HzeXi75Nt9m2dlvlNkcedvyurksHudZ39IuTRqhB9ZZQ6iM6OHF9MJdkYSDvRNIozISinlGhxR8kicIz85Kh9O0Okc0MqAU0TgVbQUFaTSkOmhrXrTvUDmJRn3j2jX@lPzwWJ3gLspRaG1zuFqn@3hqJUdifFJEa26vbLmGvo1IUFrhgUYBB/sFDd4eonFfwmQ/2ZNYO2kMcmRVIDjawMpI9sITDE4J03s4VDV/5cxFDnEYA2AMYV1R/JM/AEWS5UO2/AI "R – Try It Online")
*-3 bytes thanks to [Scarabee](https://codegolf.stackexchange.com/users/63618/scarabee)*
An anonymous function; returns the acronym as a vector `c("N","A","T","O")` which is implicitly printed.
For once, this isn't too bad in R! splits on `-` or `(space)`, takes the first element of each of those, and then returns whichever ones are capitals (`LETTERS` is an R builtin with the capital letters), in order.
[Answer]
# [Python 2](https://docs.python.org/2/), ~~59~~ 56 bytes
-3 bytes thanks to [Lynn](https://codegolf.stackexchange.com/questions/133721/generate-an-acronym#comment328521_133726)
```
lambda s:[b for a,b in zip(' '+s,s)if'@'<b<'['>a in' -']
```
[Try it online!](https://tio.run/##NYzBbsIwEER/ZXoyqPGFI6K0oQmnikhAW1WUw4Y4iSVjR/ZGFH4@dah62Z15M5ruyq2zs6F@@h4MncuKEOaHErXzoKSEtrjpbiIgHkMSproWL2JRLsRBLCmGAlIch7EcxupB7JSp5clZJm1VhXdbKX8hVh4rr4hbbRukXUeeuA8iEZt0XyBlQ5b1Cfttnu6/UPiGrL4Ra2djJ8vXr8UGsyhbZYxLcHHeVA/RG920LPOzZh6XK@0yFfFnS4zMqQBuFdbuBzu6PsdgpQKj9lrZKmBdbPOPXPpxh/qmlUXPeHO9zCKRMh7cBSAlYXy40z/yD5CK47zz2jJCzJYiqSdhOvwC "Python 2 – Try It Online")
[Answer]
# Javascript 21 bytes
Takes a string input and outputs an array of strings containing the acronym characters
```
x=>x.match(/\b[A-Z]/g)
```
## Explanation
It's just a global regex match for word-boundary followed by a capital letter.
[Answer]
# [Retina](https://github.com/m-ender/retina), ~~21~~ 17 bytes
```
!`(?<=^| |-)[A-Z]
```
[Try it online!](https://tio.run/##K0otycxL/P9fMUHD3sY2rkahRlcz2lE3Kvb///CMxBIFl/zUYoWSjFQFt/wKheDESnsA "Retina – Try It Online")
### Explanation
Outputs the matches of the regex `(?<=^| |-)[A-Z]` in the input, one per line (`!`).
[Answer]
# Dyalog APL, ~~29~~ 23 bytes
*Bonus test case: A Programming Language (APL).*
```
'(?<=^| |-)[A-Z]'⎕S'&'⊢
```
Returns an array of chars (shows as space seperated on TIO).
[Try it online!](https://tio.run/##JYyxCsIwFEV3v@JNRof8gVICrZNYsQVRUXjYmgTSROoLWOns4CAu/oCf1h@pta7nnnvwbHhWoXGybU/N/cVGwWR6qKHm453g2z1rnu@EDVnz@HQCsIVIYxBk0JI@QrqKRLqBuJRo9Q1JO8sGnWW0VMSjQhNpKyHTLsz7Ya2QIHT5BUjlMHNXSLAK/h/0UvHYE8yd52HPBCxLJ0ssil9mjlZ6lDn7Ag)
---
### Older post, 29 bytes
```
{(⎕AV~⎕A)~⍨'(\w)\w+'⎕R'\1'⊢⍵}
```
[Try it online!](https://tio.run/##JYwxCsJAFER7T/G7NUgKTyALiZUY0aAIaT4mbhY2uxJ/iFFMaSFEbLyAlRfwQnuRGLWZ4s2bwZ1y4wqVEW27tZf7qW9vD76sv@nUtnmxflQ6UTlgHZmzaMjs9Wmb97nTgU15GAAnhZrkBsK5z8M1BLlALY9I0mjW6ywlRUqun0kiqQXE0njJr1ilSOCZZA@UJjA2B1hgNfpvsBCpGxQEE1O43o9xmOVG5Jhl35sJalGgSNgH)
**How?**
`'(\w)\w+'⎕R` - replace each cluster of alphabetic chars
    `'\1'` - with its first character
`~⍨` - remove every char
    `(⎕AV~⎕A)` - that is not an ASCII uppercase
[Answer]
# Python, 53 bytes
```
import re
lambda s:re.findall("(?<=[ -])[A-Z]"," "+s)
```
[Try it online!](https://tio.run/##HY/BTsMwEETvfMXiU6LGHOBWUaqUpCfUSG0BQelhqZ14JdeONhuV8vNB5jZ6M3rS9FdxMTxM7eJr8nj@NgjDnO1dS8Gg95nKlo@LA@hjfij151EVCtRsyG/o3EcWYDu1kYGAAhzUzvpWn2IQpGANvAZj@YJiGVZsURyFDsq@R0YZB1WA2pT7BkrxGIROsN/W5f4DGu4w0C8KxZBGVb1@bjZwn7Kz3scCLpG9uU3AU@dE12cSSXZDsbKJvzsUqKIdQJyFdfyBHV6XqVnZQaBlssEMsG629Vut@V@FY@d0Mwq8xFFX6jjvmYJkNFOgn9Jt4azNKM/z6Q8 "Python 3 – Try It Online")
A simple regular expression with a lookahead for space or dash. Rather than matching the start, prepend a space.
[Answer]
# C#, ~~84~~ 78 bytes
```
using System.Linq;s=>s.Where((c,i)=>c>64&c<91&(i>0?s[i-1]==32|s[i-1]==45:1>0))
```
*Saved 6 bytes thanks to [@jkelm](https://codegolf.stackexchange.com/questions/133721/generate-an-acronym/133726#comment328518_133728).*
[Try it online!](https://tio.run/##pZLfT9swEMff81fceECJVFeUH5OgTVBo0gmpI6jtqKZpDzfnmlhybGY7MLbxt5eEwgOTePHuxac73@e@dza3rNFKb1srVAXLB@uoGU61lMSd0MoOP5EiI/g4eHNjLtTPcRBwidbCdfAngM6sQyc43GlRwmcUKoyew7tkby/Fs1bxiXWm4w3gMldtQwZ/SJrwGk2SwAZi2No4scN1TYbCkA9EFCc8@Xi8zyeno/1QJAfn9ptgo@9xfHT499U9PjkbJQdRtO2k/dNz2s2iJQ3XRjjq1FO4E9AnOLpwE@4tSW4Y18p10qmEL6okc4@ODFwYQlf346e3t2jQtXYviqKxRxOEa6Mrg03T4@aoqhYr8qVdpasCUidR9YtfLfJ09RUKU6ESv7F/P19wls@mxRUc@tbXJKUewL02svzgC5Giqh3LG@Fcv6xS6Mx7U@saHWSaLLiaYKZ/wRIfzn1pRxk0@o5dkvc/kNhWNStaB3PdsswXc0HWwcYIUqWFWbHIb3JmfGHgW8gYAGMI/dE5/4d5pUC647wHWhCWz5yXXo/B4/YJ "C# (Mono) – Try It Online")
Full/Formatted Version:
```
using System.Collections.Generic;
using System.Linq;
class P
{
    static void Main()
    {
        System.Func<string, IEnumerable<char>> f = s => s.Where((c, i) => c > 64 & c < 91 & (i > 0 ? s[i-1] == 32 | s[i-1] == 45: 1 > 0));
        System.Console.WriteLine(string.Concat(f("Self-contained Underwater Breathing Apparatus")));
        System.Console.WriteLine(string.Concat(f("a Programming Language")));
        System.Console.WriteLine(string.Concat(f("NATO Atlantic TREATY Organization")));
        System.Console.WriteLine(string.Concat(f("DEFCON 2")));
        System.Console.WriteLine(string.Concat(f("hello, world!")));
        System.Console.WriteLine(string.Concat(f("light-Emitting dioDe")));
        System.Console.WriteLine(string.Concat(f("What Does the Fox Say?")));
        System.Console.WriteLine(string.Concat(f("3D mov-Ies")));
        System.Console.WriteLine(string.Concat(f("laugh-Out Lou-D")));
        System.Console.WriteLine(string.Concat(f("Best friends FOREVE-r")));
        System.Console.WriteLine(string.Concat(f(" ")));
        System.Console.WriteLine(string.Concat(f("--  --a -  - --")));
        System.Console.WriteLine(string.Concat(f("--  -- -  - -- A")));
        System.Console.ReadLine();
    }
}
```
[Answer]
# Julia 0.6.0 (57 bytes)
```
s=split(s,r" |-");for w∈s isupper(w[1])&&print(w[1])end
```
Explanation:
This is my first code-golf. Pretty straight forward. Split the words, print 1rst upper letter of each.
Probably easy to do better using regex but I am new to this
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 11 bytes
```
'-ð‡ð¡ζнAuÃ
```
[Try it online!](https://tio.run/##AUoAtf8wNWFiMWX//yctw7DigKHDsMKhzrbQvUF1w4P//1NlbGYtY29udGFpbmVkIFVuZGVyd2F0ZXIgQnJlYXRoaW5nIEFwcGFyYXR1cw "05AB1E – Try It Online")
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), 108 bytes
```
n=>{var j="";n=' '+n;for(int i=0;++i<n.Length;)if(" -".IndexOf(n[i-1])>=0&n[i]>64&n[i]<91)j+=n[i];return j;}
```
[Try it online!](https://tio.run/##dU9Ra4MwGHz3V3xksCpOaccYjBhhEwYDRwsd7GH0IdUY4/QLS2KZiL/d2e65cNwdfHccX2GjQhsx91ahhP1gneioV7TcWvgZPeu4UwWctCrhnSv0g9F77bFIrDNL4e5fUpBsRpaOJ26gYYRQZCtYhUgrbXyFDhRb0zBUCca5QOlqGqjKJxCR@A1L8butfPxS0eYQpGx9u9hD@vhw0eRpEzQhO1tqhOsNQkOnmXqZRqtbEX8a5USuUPjSJxx2RkvDu@78Tc5R9lwKEgRX8tkN7Pvi28Kzg0yXQuq2up7@qJWFBcvGkR/bAba40D28DE4sB4Td4OpLfZrmPw "C# (.NET Core) – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~11~~ 10 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
-1 byte thanks to [Erik the Outgolfer](https://codegolf.stackexchange.com/questions/133721/generate-an-acronym/133728#comment328515_133742) (`Ḳ` splits at spaces >\_<)
```
⁾- yḲḢ€fØA
```
A monadic link taking and returning lists of characters.  
As a full program accepts a string and prints the result.
**[Try it online!](https://tio.run/##AS4A0f9qZWxsef//4oG@LSB54biy4bii4oKsZsOYQf///yJsYXVnaC1PdXQgTG91LUQi "Jelly – Try It Online")** or see a [test suite](https://tio.run/##NY6xTsMwFEV3f8VjxwusCOSSREKqGtQGUMen5sUxcuzIeaGEDRZ@gZmZCTFUQmLpl6Q/EhIJpnvOHa7uPVnbDcPh@UdC1@8@@9374eWj2L@pof/@2r@Osh6GFdlCbrxjNI5yuHE5hS0yBZgFQi6N06DqGgNy2wiE6@B1wKqa@jk63aImsVBZCootOjYbyJaxytaQBo3OPCEb70QUJ5fpAk5EOb7yx7D1weZHwhpdsowrwzwN5sZHJO5KZIg8NcAlQeIfYYXdhTiNoPIP8ooaYbHVpUxbhrlvZSRm1DAUwZDLG0jSZXwbyyCkFGdNjRs6HxFASoQpRvjzfwX1Cw "Jelly - Try It Online").
### How?
```
⁾- yḲḢ€fØA - Link: list of characters, x       e.g. "Pro-Am Code-golf Association"
   y       - translate x with:
⁾-         -   literal list of characters ['-',' '] "Pro Am Code golf Association"
    Ḳ      - split at spaces               ["Pro","Am","Code","golf","Association"]
     Ḣ€    - head each (1st character of each)      "PACgA"
        ØA - yield uppercase alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
       f   - filter keep                            "PACA"
           - if running as a full program: implicit print
```
[Answer]
# [Perl 5](https://www.perl.org/), 25 bytes
**24 bytes code + 1 for `-n`.**
Annoying that `grep -P` support variable length look-behind but Perl doesn't :(.
```
print/(?:^| |-)([A-Z])/g
```
-1 byte thanks to [@Dada](https://codegolf.stackexchange.com/users/55508/dada)!
[Try it online!](https://tio.run/##NY9PS8NAEMXv8ynGWwuOBcWLl5o2qQptI7YqWioMzXSzsNkNm4lV8bMbG9DL7/05PHi1RHfZdXW0XkeD8dXb9wZpOxxsEnrdDkem61bi9rQLXtl6KfDRFxIPrBJxEoW1tN5gUtccWdsGGO9jMJGrqu/n7E3LRmCZrHNM1LFXu8P1Q5asXzCPhr39YrXBQ5rNpvkSz6EU58IpHkJ0xQk4a0qlrLKq/WBhQyrwXLJiGqRBLQVn4QNX/DmGixSr8E530oDj1pSUt4rz0FIKE2kU99GKLxqc5Q/ZU0YRiACPQCRi7OVo/vJ/xARWKjXdir@@qdg6WhyBPc6mYYEV/IS6P9B05N0v "Perl 5 – Try It Online") - includes `-l` to run all tests at once.
[Answer]
# [MATL](https://github.com/lmendo/MATL), 19 bytes
```
'- 'X{&Yb'^[A-Z]'XX
```
[Try it online!](https://tio.run/##FclBCsIwEEDRfU8xK2cVEG8QTV22oBFaRXFs03YgTUscEfTwse4@748kPt0TKsDqu6ofeLtodb5iVSWTrRsDmU14dL5TzRSEOLgWTqF18U3iImyjIxk49KDnmSLJ64kZeu4HUfnIIv/V8mTcwibf78oCNksW2pagxVMQbsAecm1rKGNPgT8kPAX8AQ "MATL – Try It Online")
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), ~~25~~ ~~23~~ 22 bytes
```
,Ṣ↻s₂ᶠ{h∈" -"&t.∧Ạụ∋}ˢ
```
[Try it online!](https://tio.run/##HY49TsNAEIWvMmyRypsiXAAThx8piREOBaIa4mW90no32oyJIEqTIjKi4QgREqKlAYnkCJzCvojxpphvRu89Pc29w2n2pK3sNct681Wv10knYMCBBUm1e1lV329NUP2@15v9vDWrn@0yq8uyTbAOdevys9ptq/1HXb6u/t6b5o4lQj/wqTWEyogUbkwq3AJJODh1AilTRkI4m6FDKuYsAIZw5ax0mOfeGqKRBUrhnXE4iSEkjYbUFCbXg3ByC7GTaNQzkrLGh6LBWT8eQ8/fmdDaBrCwTqdHXtBKZsQHuSLy5amy0aH5OILcPvJLcfhAYyEzHhcEQ1vwyEucA7Tj6XfotYTEjF8Ic3Keo9J81AI8un07gpz9Aw "Brachylog – Try It Online")
*(-2 bytes thanks to @Fatalize.)*
```
,Ṣ↻                      % prepend a space to input
   s₂ᶠ                   % get all substrings of length 2 from that, to get prefix-character pairs
      {              }ˢ  % get the successful outputs from this predicate: 
       h∈" -"              % the prefix is - or space
               &t.∧        % then the character is the output of this predicate if:
                  Ạụ∋        % the alphabet uppercased contains the character
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~19~~ ~~16~~ 14 bytes
*-2 bytes thanks to Shaggy*
```
f/^| |-)\A/ mÌ
```
[Try it online!](http://ethproductions.github.io/japt/?v=2.0&code=Zi9efCB8LSlcQS8gbWZcQQ==&input=Ik5BVE8gQXRsYW50aWMgVFJFQVRZIE9yZ2FuaXphdGlvbiI=)
[Answer]
# [Swift 5](https://swift.org), 110 bytes
-5 thanks to [Cœur](https://codegolf.stackexchange.com/users/26980/c%c5%93ur)
```
import UIKit
func f(s:[String]){for i in zip(s,[" "]+s){if i.0.isUppercase()&&"- ".contains(i.1){print(i.0)}}}
```
---
## Detailed Explanation
* `import Foundation` - Imports the module `Foundation` that is vital for `zip()`, the main piece of this code.
* `func f(s:[String]){...}` - Creates a function with a parameter `s`, that is a list of Strings, representing the characters of the input.
* `for i in zip(s,[" "]+s){...}` - Iterates with `i` through the zip of the input and the input with a space added in the beginning, which is *very* helpful for getting the previous character in the String.
* `if` - Checks whether:
	+ `i.0==i.0.uppercased()` - The current character is uppercase,
	+ `&&"- ".contains(i.1)` - and If the previous character is a space or a dash.
* If the above conditions are met, then:
	+ `print(i.0)` - The character is printed, because it is part of the acronym.
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 43 bytes
```
''+($args|sls '(?<=^| |-)[A-Z]'-a -ca|% m*)
```
[Try it online!](https://tio.run/##NZDRT8IwEMbf91ecybCg1Ad9VAKDDTURZgA1atRcWNc16VrSdqIy/vZJQV@@u/y@y@W7W@k1M7ZgUjZh3ts0hJy2QzTc1lZaIO3@Ve@9hpp2XiP68kYoAl1i3YLypNNsgyB0zDroDdoBmTOZ06VWDoViGTyojJk1OmZgaBi6QigO0WqFBl1lSTcgCPdGc4Nl6a07VLxCzrwzjRYpRE6icmIJi1kSLZ4hNRyV@EEntPJDcTIepVM4973Pr7uw1kZmRx5IwQtHk1I455dnQsf7zU8FOog1s@AKBmP9BXP87nvnIoZSf9Jbts8mseIFTSsHd7qisUdDf2luBFOZhXE6Sx4TarxBqVc4tADU/2hX4MAP6J9A5NncsRW9YWpwXaKQdLIT8HI20hMoSdD5e2zd2oQfl3Ac5rCrhGybXw "PowerShell – Try It Online")
Unrolled:
```
''+($args|select-string '(?<=^| |-)[A-Z]' -allmatches -caseSensitive|% matches)
```
[Answer]
# [Python 3](https://docs.python.org/3/), 67 bytes
```
lambda x:[c[0]for c in x.replace("-"," ").split()if c[0].isupper()]
```
[Try it online!](https://tio.run/##K6gsycjPM/7/PycxNyklUaHCKjo52iA2Lb9IIVkhM0@hQq8otSAnMTlVQ0lXSUdJQUlTr7ggJ7NEQzMzTQGkUi@zuLSgILVIQzP2/38A "Python 3 – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), ~~73~~ 70 bytes
```
lambda n:[n[x]for x in range(len(n))if'@'<n[x]<'['and(' '+n)[x]in' -']
```
[Try it online!](https://tio.run/##HYxNb8IwEET/yjYXJwJf2huiH6EJp4pIQIuqlMMWO8lKZh05GwH982nd2@jNzOtv0nl@mJrHr8nh@dsg8KLm@npsfIArEENAbm3qLKecZdSoF7WM/VLVCtmkCtSMsz9ArECr4xSPFI91srOu0SfPgsTWwDsbGy4oNsAqWJSOuIW87zGgjEMyh2ST7yvIxSELnWC/LfP9J1ShRaYfFPIcR0W5fq02cB9zZ53zc7j44MxdBI7aTnR5JpFoN@QLG/mhQ4HC2wGks7D2V9jh7Tk2KzsINIEsmwHW1bb8KHX4V@HYdroaBd78qIvkuOgDsaQ0S0A/QTIbJKRNSlmWTb8 "Python 3 – Try It Online")
---
# Explanation
* `lambda n:` - Creates an anonymous lambda-function with a String parameter `n`.
* `n[x]` - Gets the character of `n` at index `x`.
* `for x in range(len(n))` - Iterates from `0` to the length of `n`, naming the variable `x`.
* `if` - Checks:
	+ `'@'<n[x]<'['` - If the character is uppercase,
	+ `and(' '+n)[x]in' -'` - And if it is preceded by a space or a dash in the String formed by a space and `n`.
[Answer]
# [JavaScript (SpiderMonkey)](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/45), 62 bytes
```
n=s=>(""+s.match(/([ -]|^)[A-Z]/g)).replace(/[ \-,]|null/g,"")
```
[Try it online!](https://tio.run/##JY9NT8JAEIbv/IpxT21oaeLVoKkWTgaMYIyWmkzaYbu63W12BxDDf68snObjmbyT5xv36Gunek59rxpynTU/dBwGM/XT@0iIsZ90yHUbZVEJaXX6iss8/awyGccTR73GmqKshE2aVCez0zqTiRDxsEcHTJ49TKEUK9LbtLaGURlq4M2cHx2QycGjI@RWGQl536ND3nmRgEB4cVY67LqAntHIHUoKZJGvl5CzRsOqhvXrLF9/wNJJNOoPWVkTjorZ/Gm5gNvQt6S1TeBgnW5uwkIr2XI66xRzCG@ULS7J7y0yFJY8cEswt7@wwuODqEajrXUQBRuw26tVDGcbbzVNtJVXNAaxMeJczGWO47vhHw "JavaScript (SpiderMonkey) – Try It Online")
[Answer]
# [QuadS](https://github.com/abrudz/QuadRS), 17 bytes
```
(?<=^| |-)[A-Z]
&
```
[Try it online!](https://tio.run/##KyxNTCn@/1/D3sY2rkahRlcz2lE3KpZL7f9/P8cQfwXHkpzEvJLMZIWQIFfHkEgF/6L0xLzMqsSSzPw8AA)
[Answer]
# Pyth, ~~15~~ 16 bytes
```
@rG1<R1:w"[ -]"3
```
[Test suite](https://pyth.herokuapp.com/?code=%40rG1%3CR1%3Aw%22%5B+-%5D%223&input=Self-contained+Underwater+Breathing+Apparatus&test_suite=1&test_suite_input=Self-contained+Underwater+Breathing+Apparatus%0Aa+Programming+Language%0ANATO+Atlantic+TREATY+Organization%0ADEFCON+2%0Ahello%2C+world%21%0Alight-Emitting+dioDe%0AWhat+Does+the+Fox+Say%3F%0A3D+mov-Ies%0Alaugh-Out+Lou-D%0ABest+friends+FOREVE-r%0A--%0A+&debug=0)
[Answer]
# Pyth, 12 bytes
```
@rG1hMcXz\-d
```
[Test suite here.](http://pyth.herokuapp.com/?code=%40rG1hMcXz%5C-d&test_suite=1&test_suite_input=Self-contained+Underwater+Breathing+Apparatus%0Aa+Programming+Language%0ANATO+Atlantic+TREATY+Organization%0ADEFCON+2%0Ahello%2C+world%21%0Alight-Emitting+dioDe%0AWhat+Does+the+Fox+Say%3F%0A3D+mov-Ies%0Alaugh-Out+Lou-D%0ABest+friends+FOREVE-r%0A--%0A+%0A--++--a+-++-+--%0A--++--+-++-+--+A&debug=0)
[Answer]
# Bash (grep), ~~29~~ 28 bytes
```
grep -oP'(?<=^| |-)[A-Z]' a
```
A port of my python answer but because `pgrep` supports variable length lookbehinds it's noticeably shorter (even accounting for the overhead of python). Stick the test cases in a file called `a`, output is 1 character per line.
-1 Thanks to [Neil](https://codegolf.stackexchange.com/questions/133721/generate-an-acronym/133742#comment328593_133749)
[Answer]
# [RProgN 2](https://github.com/TehFlaminTaco/RProgN-2), 18 bytes
```
`-` rû#ùr.'[a-z]'-
```
## Explained
```
`-` rû#ùr.'[a-z]'-
`-`                     # Push "-" literal, and " " literal.
    r                   # replace, Replaces all "-"s with " "s.
     û                  # Split, defaultly by spaces.
      #ù                # Push the head function literally.
        r               # Replace each element of the split string by the head function, which gets each first character.
         .              # Concatenate, which collapses the stack back to a string.
          '[a-z]'-      # Push the string "[a-z]" literally, then remove it from the string underneith, giving us our output. 
```
[Try it online!](https://tio.run/##Kyooyk/P0zX6/z9BN0Gh6PBu5cM7i/TUoxN1q2LVdf///x9QlK/rmKvgnJ@Sqpuen5Om4FhcnJ@cmViSmZ8HAA "RProgN 2 – Try It Online")
[Answer]
# PHP, 62 bytes
```
for(;~$c=$argn[$i++];$p=$c!="-"&$c!=" ")$c<A|$c>Z|$p?:print$c;
```
Run as pipe with `-nR` or [try it online](http://sandbox.onlinephpfunctions.com/code/9c260696f28353dc75d4a9b0da637cb2fd63623f).
other solutions:
```
foreach(preg_split("#[ -]#",$argn)as$s)$s[0]>Z|$s<A?:print$s[0];  # 64 bytes
preg_match_all("#(?<=\s|-)[A-Z]#"," $argn",$m);echo join($m[0]);  # 64 bytes
preg_match_all("#(?<=\s|-)\p{Lu}#"," $argn",$m);echo join($m[0]); # 65 bytes
```
[Answer]
## C++, 168 bytes
```
#include<string>
auto a=[](auto&s){auto r=s.substr(0,1);if(r[0]<65||r[0]>90)r="";for(int i=1;i<s.size();++i)if(s[i]>64&&s[i]<91&&(s[i-1]==32||s[i-1]==45))r+=s[i];s=r;};
```
Output done via the parameter
[Answer]
## [Lua](https://lua.org/), 79 75 bytes
```
for i=1,#t do for i in(" "..t[i]):gmatch"[%-| ]%u"do print(i:sub(2))end end
```
[Try it!](https://tio.run/##NY7dTsJAEIVf5VhDCkmXRLwjIVpoUROhCaDGEC5WurSbbHeb7az4@@x1i3pz5pxvJjOjHG8JE3yGa6EObG80calFjgedC3vkJCymVnAqpS4Q1zW3nFwTRuEy3mSISXFNco/NKo03z8hswbX84CSN9jNJOp9lS4y8LYVSJsLRWJWf@axkURJLK0nUbc6lSYTHTyUnJEY0oFJgbt6w5u9XvnGZoDKv7E50txV3RckyR7g3jiWeTEVDOFgpdN5gnq3Sx5RZzxnzgpMBGOPoCk70l/wDxB6tSdTsVujrm4pLxRZe0MlwZhaowu/2YCzk5CI6J@QGpwSp@wGC4ZC2cjcYFxWnfRlse@wLu54L/Fhtpaa@HDfupT@KRoOBf/IPdrZt2x8)
I stuck a print() before the final end in the try it version because otherwise it's a mess. This program perfectly adheres to the requirements of I/O and matching, but without that extra new line it's pretty hard to read.
Input is given in the form of a table of number:string , number incrementing by 1 each time and starting at 1. 
Explanation:
It for loops through a gmatch of each input string. The gmatch search is as follows:
[%-| ] - Group, search for a - or a space
%u - Search for an uppercase character
Then for each match, it prints it out minus the preceding dash or space
Edit: Golfed 4 bytes by removing the declaration of 'a' and adding the space to the input inside the for loop in, as well as changing the sub input to just 2 rather than 2,2 (which produce equivalent results)
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 12 bytes
Created one year after the initial answer.
```
rI#1hMcXQ\-d
```
[Try it online!](https://pyth.herokuapp.com/?code=rI%231hMcXQ%5C-d&input=%22Self-contained+Underwater+Breathing+Apparatus%22&debug=0)
### [Pyth](https://github.com/isaacg1/pyth), 21 bytes
Initial answer.
```
:+dQ"(?<=[ -])[A-Z]"1
```
[Try it online!](https://tio.run/##K6gsyfj/30o7JVBJw97GNlpBN1Yz2lE3KlbJ8P9/peDUnDTd5Py8ksTMvNQUhdC8lNSi8sSS1CIFp6LUxJKMzLx0BceCgsSixJLSYiUA "Pyth – Try It Online")
]