title: ERLANG - Pattern Matching specifc pattern in unknown size list
body: <p>Ok now I think Im getting warmer, I have to pattern match whatever comes in.</p>
  
  <p>So if I had say</p>
  
  <pre><code>Message = = [[&lt;&lt;&gt;&gt;], 
   [&lt;&lt;"10"&gt;&gt;,&lt;&lt;"171"&gt;&gt;],
   [&lt;&lt;"112"&gt;&gt;,&lt;&lt;"Gen20267"&gt;&gt;],
   [&lt;&lt;"52"&gt;&gt;,&lt;&lt;"20100812-06:32:30.687"&gt;&gt;]] 
  </code></pre>
  
  <p>And I was looking to pattern match the field &lt;&lt;"112">></p>
  
  <p>Such as the 112 is always going to say 112, but the Gen2067 can change whenever to whatever.. its the data, it will be stored in a variable.</p>
  
  <p>Also the fields can be in any order, whatever function im trying to do has to be able to find the field and parse it.</p>
  
  <p>This is the code I am using right now:</p>
  
  <pre><code>loop() -&gt;
  receive
      [_,[&lt;&lt;"112"&gt;&gt;, Data], _] when is_list(X) -&gt; %% Just dosen't work in anyway..
          ?DEBUG("Got a list ~p~n", [X]),
          loop();
      _Other -&gt;
          ?DEBUG("I don't understand ~p~n", [_Other]),
          loop()
  end.
  </code></pre>
  
  <p>I feel im close, but not 100%</p>
  
  <p>-B</p>