Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use Benchmark qw/cmpthese/;
- use Data::Dumper;
- my @set= qw (123456 677 233 10000 11000 30 1 200
- 120007 12 350 440 55 55 84213 999999
- 300000 1000000 2500000 400000000
- 22 0 1000 82468 7305 5 880000 10002000
- 111 8990 578901 9999999 7777);
- cmpthese(-10,{
- regex2=> sub {
- grep { /\b\d{1,6}\b/g} @set ;
- },
- regex1=> sub {
- grep { /(?<= )\w\w?+\w?+\w?+\w?+\w?+(?= )|123456/g} @set ;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement