title: MongoDB regex string startswith and endswith
body: <p>So i have something that looks like this </p>
  
  <pre><code>db.usuarios.insert
  (
      [
          {
              "nome" : "neymala",
              "idade" : 40,
              "status" : "solteira"
          },
          {
              "nome" : "gabriel",
              "idade" : 31,
              "status" : "casado"
          },
          {
              "nome" : "jose",
              "idade" : 25,
              "status" : "solteiro"
          },
          {
              "nome" : "manoel",
              "idade" : 25,
              "status" : "solteiro",
              "interesses" : [
                  "esporte",
                  "musica"
              ]
          }
      ]
  )
  </code></pre>
  
  <p>I would like to find names that starts with ma and ends with l, for example "manoel" or "manuel"</p>
  
  <p>I have figured out how to do one or the other with the fallowing querys:</p>
  
  <pre><code>db.usuarios.find({nome:{$regex: /^ma/ }})
  
  db.usuarios.find({nome:{$regex: /l$/ }})
  </code></pre>
  
  <p>Now i would like to combine them into a single query.</p>