title: Regex to capture a substring containing punctuation in R
body: <p>I have a list of strings where each element contains uppercase names with and without punctuation, followed by a sentence.</p>
  <pre><code>names_list = list(&quot;MICKEY MOUSE is a Disney character&quot;,
                    &quot;DAFFY DUCK is a Warner Bros. character&quot;,
                    &quot;GARFIELD, ODI AND JOHN are characters from a USA cartoon comic strip.&quot;,
                    &quot;BUGS-BUNNY AND FRIENDS Warner Bros. owns these characters.&quot;)
  </code></pre>
  <p>I want to extract only the capitalised names at the start of each string. I got as far as:</p>
  <pre><code>library('stringr')
  str_extract(names_list, '([:upper:]+([:punct:]?[:upper:]?)[:space:])+')
  
  [1] &quot;MICKEY MOUSE &quot;           &quot;DAFFY DUCK &quot;             &quot;GARFIELD, ODI AND JOHN &quot; &quot;BUNNY AND FRIENDS &quot;
  </code></pre>
  <p>I can't figure out how to specify the mid-word punctuation as in &quot;BUGS-BUNNY&quot; so that I can pull out the whole word. Help much appreciated!</p>