File tree Expand file tree Collapse file tree 5 files changed +22
-6
lines changed Expand file tree Collapse file tree 5 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 1+ 1.21 2022-01-12 08:49:06-07:00 Europe/Moscow
2+ - Regex::Object::Matches->captures_all typo in method body with collection spelled with one 'l'
3+
141.20 2022-01-12 18:49:03-05:00 Europe/Moscow
25 - Regex::Object::Matches collection
36 - Regex::Object->match_all method to abstract from while when global searching
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ license = Perl_5
55copyright_holder = Alexander Panteleev
66copyright_year = 2022
77
8- version = 1.20
8+ version = 1.21
99
1010[AutoPrereqs]
1111
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ use Regex::Object::Matches;
1111use Moo;
1212use namespace::clean;
1313
14- our $VERSION = ' 1.20 ' ;
14+ our $VERSION = ' 1.21 ' ;
1515
1616tie my %nc , " Tie::Hash::NamedCapture" ;
1717tie my %nca , " Tie::Hash::NamedCapture" , all => 1;
@@ -84,7 +84,7 @@ Regex::Object - solves problems with global Regex variables side effects.
8484
8585=head1 VERSION
8686
87- version 1.20
87+ version 1.21
8888
8989=head1 SYNOPSIS
9090
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ sub match_all {
2222sub captures_all {
2323 my $self = shift ;
2424
25- return [map { $_ -> captures } @{$self -> colection }];
25+ return [map { $_ -> captures } @{$self -> collection }];
2626}
2727
28281;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ use strict;
22use warnings qw/ FATAL/ ;
33use utf8;
44
5- use Test::Simple tests => 7 ;
5+ use Test::Simple tests => 8 ;
66use Regex::Object;
77
88$| =1;
@@ -99,7 +99,7 @@ ok($result eq $expected,
9999);
100100
101101# # TEST 7
102- # Test global matching with scoped regex with modifiers
102+ # Test global matching with scoped regex with modifiers: match_all method
103103
104104$re = Regex::Object-> new(
105105 regex => qr / ([A-Z]+?) ([A-Z]+)/ i ,
@@ -114,3 +114,16 @@ ok($result eq $expected,
114114 $expected ,
115115 )
116116);
117+
118+ # # TEST 8
119+ # Test global matching with scoped regex with modifiers: captures_all
120+
121+ $expected = ' John Doe Eric Lide Hans Zimmermann' ;
122+ $result = join " \040 " , map { join " \040 " , @$_ } @{ $re -> match_all($expected )-> captures_all };
123+
124+ ok($result eq $expected ,
125+ sprintf (' Returns wrong value: %s, expected: %s' ,
126+ $result ,
127+ $expected ,
128+ )
129+ );
You can’t perform that action at this time.
0 commit comments