in reply to how to measure strictness of a regex ?
re::regmust may be of some help...
use 5.014; use strict; use warnings; use re (); use List::Util 'sum'; sub re_strictness ($) { sum map length, re::regmust shift } say re_strictness qr/Dad+y/; # says 5 say re_strictness qr/D.+/; # says 1
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: how to measure strictness of a regex ?
by AnomalousMonk (Archbishop) on Jan 23, 2013 at 01:22 UTC | |
by tobyink (Canon) on Jan 23, 2013 at 07:47 UTC |
In Section
Seekers of Perl Wisdom