title: Allow only lowercase letters in regex (along with "." and "_" but I have that already)
body: <p>I'm sorry, I'm sure this will get marked as duplicate but I can not get my regex to work properly.</p>
  
  <p>I want my regex to only allow lowercase letters, periods, and underscores. I'm using the instagram regex from the community patterns found here <a href="https://regexr.com/3cg7r" rel="nofollow noreferrer">https://regexr.com/3cg7r</a></p>
  
  <p>The pattern looks like <code>^(?!.*\.\.)(?!.*\.$)[^\W][\w.]{0,29}$</code></p>
  
  <p>Figured I could add <code>[a-z]</code> at the beginning of the pattern right after the carrot "^" but that didn't do anything. I tried various other ways like <code>[^A-Z]</code> which I thought would work but didn't.</p>
  
  <p>Can someone steer me in the right direction?</p>
  
  <p>Edit:</p>
  
  <p>I want to match:</p>
  
  <p><code>test_handle</code></p>
  
  <p><code>test.handle</code></p>
  
  <p><code>testhandle</code></p>
  
  <p><code>test_._handle</code></p>
  
  <p>Don't want to match:</p>
  
  <p><code>Test_handle</code></p>
  
  <p><code>test_Handle</code></p>
  
  <p><code>test__handle</code></p>
  
  <p><code>test..handle</code></p>
  
  <p><code>TESTHANDLE</code></p>
  
  <p>an</p>