title: using regex to skip ahead all characters until a specific sequence of letters is found using negative lookahead
body: <p>I'm alright with basic regular expressions, but I get a bit lost around pos/neg look aheads/behinds.</p>
  
  <p>I'm trying to pull the id # from this:</p>
  
  <pre>[keyword stuff=otherstuff id=123 morestuff=stuff]</pre>
  
  <p>There could be unlimited amounts of "stuff" before or after.
  I've been using The Regex Coach to help debug what I've tried, but I'm not moving forward anymore...</p>
  
  <p>So far I have this:</p>
  
  <pre><code>\[keyword (?:id=([0-9]+))?[^\]]*\]
  </code></pre>
  
  <p>Which takes care of any extra attributes after the id, but I can't figure out how to ignore everything between keyword and id.
  I know I can't go <code>[^id]*</code>
  I believe I need to use a negative lookahead like this <code>(?!id)*</code> but I guess since it's zero-width, it doesn't move forward from there.
  This doesn't work either:</p>
  
  <pre><code>\[keyword[A-z0-9 =]*(?!id)(?:id=([0-9]+))?[^\]]*\]
  </code></pre>
  
  <p>I've been looking all over for examples, but haven't found any.  Or perhaps I have, but they went so far over my head I didn't even realize what they were.</p>
  
  <p>Help!
  Thanks.</p>
  
  <p>EDIT:
  It has to match [keyword stuff=otherstuff] as well, where id= doesn't exist at all, so I have to have a 1 or 0 on the id # group.  There are also other [otherkeywords id=32] which I do not want to match.  The document needs to match multiple [keyword id=3] throughout the documents using preg_match_all.</p>