title: how do you extract values between two characters in R?
body: <p>I am trying to extract the server name (server101) from this string in R using regular expression:</p>
  
  <p>value between <strong>@</strong> and the following first <strong>period (.)</strong></p>
  
  <pre><code>t&lt;-c("Current CPU load - jvm machine[example network-app_svc_group_mem4]@server101.example.com")
  </code></pre>
  
  <p>I've tried this:</p>
  
  <pre><code>gsub('.*\\@(\\d+),(\\d+).*', '\\1', t)
  </code></pre>
  
  <p>this does not seem to be working, any ideas?</p>