http://qs321.pair.com?node_id=1171491


in reply to Get a known substring from a string

Just do this:
if ($str =~ m/(thispart)/) { $found = $1; }
$1 is set to the part that matches the regex in between the brackets.