title: Regmatches in R not working
body: <p>I am trying to add a column to a data set in R. The column should be the initials from a name column. I am trying to use <code>lapply</code> and passing in a function to get the initials - however, I can't get this regexp to work.</p>
  
  <pre><code>pattern &lt;- "(\b[a-zA-Z])"
  str&lt;-"MICHAEL,  JENSON F"
  m &lt;- regexpr(pattern,str,perl=TRUE)
  regmatches(str,m)
  </code></pre>
  
  <p>Returns character(0)</p>
  
  <p>How can I have R return a list of matches of a string? I want regmatches to return M J and F.</p>