use YAPE::Regex::Explain; # Your code as posted my $regex = YAPE::Regex::Explain->new ( qr/$split_re/ ); print $regex->explain;