use YAPE::Regex::Explain; say YAPE::Regex::Explain->new( qr{/(\d.*?)/i} )->explain; #### ---------------------------------------------------------------------- ( group and capture to \1: ---------------------------------------------------------------------- \d digits (0-9) ---------------------------------------------------------------------- .*? any character except \n (0 or more times (matching the least amount possible)) ---------------------------------------------------------------------- ) end of \1 #### ---------------------------------------- \d one digit
---------------------------------------- .*? anything (except a newline), with as few as zero instances (times) of anything ...and absolutely no more than (in the case of your sample data) 'one additional digit'." ----------------------------------------