my $Level0 = qr/ \( ( [^()] )* \) /x; # Parenthesized text if ($text =~ m/\b( \w+$Level0 )/x) { print "found function call: $1\n"; } ----------------------------------------------------------------------------- Copyright 1997-2024 Jeffrey Friedl