title: HTML Lexer in Java
body: <p>I am trying to make a simple Lexer to understand how they work.  I am trying to figure out a good POSIX String that could catch Opening HTML Tags of any type.  I made one which almost worked but fails on more complex tags like meta tags and such.  So far this is what I have:</p>
  
  <pre><code>"&lt;\\p{Alnum}+(\\p{Space}\\p{Alnum}+\\p{Space}*=\"*\\p{Space}*\\p{Alnum}+\"*)*\\p{Space}*&gt;"
  </code></pre>
  
  <p>This POSIX String catches a lot of tags but misses some like meta tags and DOC tags.  Here is a tag that it failed on:</p>
  
  <pre><code>&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
  </code></pre>
  
  <p>Any help would be much appreciated.  I know this might not be the best way to make a Lexer but this is just to help me understand how Regex works.</p>