title: Cannot get Negative Lookahead regexp to properly match
body: <p>I'm trying to match strings that do not have .jsp/.jspx extensions in Java and am having a lot of difficult with the negative lookahead pattern.</p>
  
  <p>Given a bunch of strings:</p>
  
  <pre><code>String string1 = "templateName";
  String string2 = "some/path"
  String string3 = "basic/filename/no/extension"
  String string4 = "some/path/to/file.jsp"
  String string5 = "alternative/path/to/file.jspx"
  </code></pre>
  
  <p>I'm trying to find a regex that matches the first 3 and not the last 2.</p>
  
  <p>I would have thought a regex with a negative lookahead would work.</p>
  
  <p>Ex:</p>
  
  <pre><code>Pattern p = new Pattern.compile( "(.+)(?!\\.jsp[x]?)")
  </code></pre>
  
  <p>But that pattern seems to match all the above strings.  I initially thought that group 1 might be too greedy, so I've tried (.+?), but that does not help either.</p>
  
  <p>This <a href="https://stackoverflow.com/a/977294/827480">SO Post</a> does a very good job of explain the negative lookahead, but it isn't helping me unfortunately find the right combination.</p>
  
  <p>Am I missing something obvious? </p>