if($input =~ /^(\([^\)]*\))/) { my $pattern = $1; s/$pattern//; }