title: Using regex to match beginning and end of string [Java]
body: <p>I have a list of files in a folder:</p>
  
  <pre><code>maze1.in.txt
  maze2.in.txt
  maze3.in.txt
  </code></pre>
  
  <p>I've used substring to remove the .txt extensions.
  How do I use regex to match the front and the back of the file name?
  I need it to match "maze" at the front and ".in" at the back, and the middle must be a digit (can be single or double digit).</p>
  
  <p>I've tried the following</p>
  
  <pre><code>if (name.matches("name\\din")) {
      //dosomething
  }
  </code></pre>
  
  <p>It doesn't match anything. What is the correct regex expression to use?</p>