<p>I want to use regular expressions (Perl compatible) to be able to find a pattern surrounded by two other patterns, but not include the strings matching the surrounding patterns in the match.</p>

<p>For example, I want to be able to find occurrences of strings like:</p>

<blockquote>
  <p>Foo Bar Baz</p>
</blockquote>

<p>But only have the match include the middle part:</p>

<blockquote>
  <p>Bar</p>
</blockquote>

<p>I know this is possible, but I can't remember how to do it.</p>

Parentheses define the groupings.
```
```
"Foo (Bar) Baz"
```
```
Example
```
```
~> cat test.pl
$a = "The Foo Bar Baz was lass";

$a =~ m/Foo (Bar) Baz/;

print $1,"\n";
~> perl test.pl
Bar
```
```