or download this
use YAPE::Regex::Explain;
print YAPE::Regex::Explain->new(
qr/([^\r\n]+)$/s
...
----------------------------------------------------------------------
) end of grouping
----------------------------------------------------------------------