title: R - Understanding output of regexpr
body: <p>Can you pls help in understanding output of regexpr? I am interested in text position that is 10 below. But it shows two values that is 10 and 4. How do I capture number 10 only. </p>
  
  <p>Is this output a vector of numbers? </p>
  
  <pre><code>text&lt;-"World is beautiful"
  out&lt;-regexpr("beau",text)
  out
  #[1] 10
  #attr(,"match.length")
  #[1] 4
  #attr(,"useBytes")
  #[1] TRUE
  out[1]
  #[1] 10
  out[2]
  #[1] NA
  </code></pre>