title: Regex expression for: 4 letter words using 'a' to 'e' in lower case
body: <p>I can manage to get the four letter word from a-z using this <code>^[a-z]{4}$</code> But I am not sure how to get it so there is a a and e in in the word. I've tried this but it only gets the worlds with the ae on the end. <code>^[a-z]{2}[a][e]$</code></p>
  
  <pre><code>import re
  import sys
  import time
  
  pattern = '^[a-z]{4}$[a][e]' 
  
  #c = ^[^a][a]{2}
  
  regexp = re.compile(pattern)
  
  inFile = open('words.txt','r')
  outFile = open('exercise04.log','w')
  
  
  for line in inFile:
      match = regexp.search(line)
      if match:
          time.sleep(0.1)
          print(line)
          outFile.write(line)
  
  inFile.close()
  outFile.close()
  </code></pre>
  
  <p>Example output from <code>^[a-z]{2}[a][e]$</code></p>
  
  <pre><code>alae
  
  blae
  
  brae
  
  frae
  
  spae
  
  thae
  
  twae
  </code></pre>
  
  <p>I i'm looking for random words such as </p>
  
  <pre><code>akes
  aejs
  soae
  skea
  esao 
  </code></pre>