title: How to extract certain strings based on previous lines in tcl
body: <p>Suppose I have the following string: </p>
  
  <pre><code>m=audio 56000 RTP/AVP 0 8 18 205 150 101
  o=India-SIPUA 2331 0 IN IP4 10.77.34.6
  s=SIP Call
  m=audio 22058 RTP/AVP 0 8 18 105 104 101
  c=IN IP4 10.77.34.6
  </code></pre>
  
  <p>Now I need to search the second "m=audio" based on the searching of the string "o=India-SIPUA 2331 0 IN IP4 10.77.34.6"</p>
  
  <p>For this I have got the following code to search the string "o=India-SIPUA 2331 0 IN IP4 10.77.34.6" </p>
  
  <pre><code>set buffer "m=audio 56000 RTP/AVP 0 8 18 205 150 101
  o=India-SIPUA 2331 0 IN IP4 10.77.34.6
  s=SIP Call
  m=audio 22058 RTP/AVP 0 8 18 105 104 101
  c=IN IP4 10.77.34.6"
  set patt "India-SIPUA"
  set ipaddress "10.77.34.6"
  
  foreach buf [split $buffer "\n"] {
    if {[regexp "o=$patt.*$ipaddress" $buf match]} {
       puts "+++++++Port==$match++++++"
       break
    } else {
       puts "\n Not found"
    }
  }
  </code></pre>
  
  <p>Now what should I write in order to get the m=audio string which comes just after the string "o=India-SIPUA..." </p>