title: Java matching a string with wildcard regex to find <H1> tags
body: <p>I have several HTML files, each has a single <code>&lt;h1&gt;</code> tag in it. I want to parse that tag to get it's content (a name of a book). A tag looks like this for example:</p>
  
  <pre><code>&lt;H1&gt;bookname&lt;/H1&gt;
  </code></pre>
  
  <p>I am trying to get it using this code:</p>
  
  <pre><code>Scanner scan = new Scanner(file, "Windows-1255");
  String name="";
  Pattern p = Pattern.compile("&lt;H1&gt;*&lt;/H1&gt;"); //tried adding '(' and ')' around the '*', didn't help
  while (scan.hasNext()) {
      name = scan.nextLine();
      Matcher m = p.matcher(name);
      if (m.matches()) {
          name = name.substring(4, name.length() - 6);
          break;
      }
  }
  </code></pre>
  
  <p>It doesn't work, the h1 tag is never matched and I don't get the name.
  How is this supposed to be done?</p>
  
  <p>Perhaps it's important, the contents of the H1 tags are in Hebrew, charset=Windows-1255.</p>