title: Index of matching bracket character within a lambda function?
body: <p>I'm more curious than in dire need. Would it be possible to pass a lambda function two arguments <code>s</code>, and <code>i</code>. Where <code>s</code> is the string in question and <code>i</code> is the index of the first bracket; and have it return the index of the complimentary bracket?</p>
  
  <p>I should note that it only needs to work for the brackets <code>()</code>, and not <code>{}</code> or <code>[]</code>.</p>
  
  <p><strong>For example</strong></p>
  
  <pre><code>&gt;&gt;&gt; f( '(() foo ) bar' , 0)
  8
  </code></pre>
  
  <p><em><code>f</code> is defined by a lambda function</em></p>
  
  <p>Edit: I'm aware that numerous methods exist for finding the matching bracket. I, however, am curious if it can be simplified into a lambda expression.</p>