Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Document :global, :pos
  • Loading branch information
moritz committed Jan 26, 2015
1 parent c8b95f8 commit e058fc8
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions lib/Language/regexes.pod
Expand Up @@ -826,11 +826,28 @@ TODO
=head2 Global
TODO
Instead of search just one match, and returning a L<Match|/type/Match>, search
for every non-overlapping match and returns them in a L<List|/type/List>.
given 'several words here' {
my @matches = m:global/\w+/;
say @matches.elems; # 3
say ~@matches[2]; # here
}
C<:g> is a shortcut for C<:global>.
=head3 Pos
TODO
Anchor the match at a specific position in the string:
given 'abcdef' {
my $match = m:pos(2)/.*/;
say $match.from; # 2
say ~$match; # cdef
}
C<:p> is a shortcut for C<:pos>.
=head3 Overlap
Expand Down

0 comments on commit e058fc8

Please sign in to comment.