title: Java regex patter.compile() cannot be resolved symbol
body: <p>I am trying to write a regex in Java with Intellij IDE but <strong>.compile()</strong> is getting </p>
  
  <blockquote>
    <p>cannot resolve symbol 'compile'</p>
  </blockquote>
  
  <pre><code>private boolean isUrlFormatValid(String url) {
          Pattern pattern = new Pattern.compile("blabla");
          //some other stuff
      }
  </code></pre>
  
  <p>And I have imported these at the beginning of the class:</p>
  
  <pre><code>import java.util.regex.Matcher;
  import java.util.regex.Pattern;
  </code></pre>
  
  <p>.compile is not resolved. Do I need to add something else or you think something is wrong with intellij idea ?</p>
  
  <p>Note: I have also tried by defining with full path like:</p>
  
  <pre><code>Pattern p = new java.util.regex.Pattern.compile("blabla");
  </code></pre>
  
  <p>But did not work as well.</p>