title: Javascript regex to detect end of sentence
body: <p>I want to detect @username in a sentence. For this I use a simple <code>/\B@([\w]+)/ig</code>. This works well however this breaks when username contains a fullstop. For example something like, <code>@user.name</code>. So what would be the optimum regex to detect @username, where username could contain <code>a-z</code>, <code>A-Z</code>, <code>0-9</code> and a <code>.</code>.</p>
  
  <p>Test sentence 1 : <code>Find @david in the database.</code> Here regex should match <code>david</code></p>
  
  <p>Test sentence 2 : <code>Find @david.name in the database.</code> Here regex should match <code>david.name</code></p>
  
  <p>Test sentence 3 : <code>Find who is @david. And tell him something.</code> Here regex should match <code>david</code> and not <code>david.</code></p>