This is similar to Making an acronym, but there are several key differences, including the method of fetching the acronym, and this challenge including flexible output.
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.
Output may be in the format of
["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, so shortest answer in bytes wins.