Skip to content

Commit

Permalink
[regex] impmrove description of rindex(); also comment on the editori…
Browse files Browse the repository at this point in the history
…al note by chromatic++
  • Loading branch information
moritz committed Mar 6, 2010
1 parent bd06566 commit 3e7d952
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/regexes.pod
Expand Up @@ -64,6 +64,10 @@ escape it:

What are the C<index> and C<rindex> ops in Perl 6?

There's a sidebar explaining rindex -- did you miss that? Is it too far
away from the example? (I've also added an explanation for index() now)
--moritz

=end for

X<regex; metasyntactic characters>
Expand Down Expand Up @@ -845,9 +849,11 @@ the match position and calculating the difference to the match position.

=begin sidebar

The C<rindex> method searches a string for another substring, starting at the
end of the string, and moving backward until it finds the search string. It
returns the position of the search string.
The C<index> method searches a string for another substring, and returns the
position of the search string.

The C<rindex> method does the same, but searches backwards from the end of the
string, so it finds the position of the last occurrence of the substring.

=end sidebar

Expand Down

0 comments on commit 3e7d952

Please sign in to comment.