Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed broken code example and added a few missing ;
  • Loading branch information
Jan-Olof Hendig committed Sep 29, 2016
1 parent 41a7f6e commit d730103
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions doc/Language/regexes.pod6
Expand Up @@ -403,8 +403,8 @@ You can prevent backtracking in regexes by attaching a C<:> modifier
to the quantifier:
=begin code
say so 'abababa' ~~ /a .* aba/ # True
say so 'abababa' ~~ /a .*: aba/ # False
say so 'abababa' ~~ /a .* aba/; # True
say so 'abababa' ~~ /a .*: aba/; # False
=end code
=head1 X<Alternation|regex,||>
Expand Down Expand Up @@ -478,10 +478,10 @@ Keep in mind, these anchors match end of B<string>, not line:
and keep it safe
EOS
say so $s ~~ /safe $/; # True
say so $s ~~ /secret $/; # False
say so $s ~~ /^Keep /; # True
say so $s ~~ /^and /; # False
say so $str ~~ /safe $/; # True
say so $str ~~ /secret $/; # False
say so $str ~~ /^Keep /; # True
say so $str ~~ /^and /; # False
=head2 X«C<^^>, Start of Line and C<$$>, End of Line|regex,^^;regex,$$»
Expand Down Expand Up @@ -665,8 +665,8 @@ the match object as a hash, in other words: C<$/{ 'myname' }> or C<< $/<myname>
Named captures can also be nested using regular capture group syntax:
if 'abc-abc-abc' ~~ / $<string>=( [ $<part>=[abc] ]* % '-' ) / {
say ~$<string> # abc-abc-abc
say ~$<string><part> # [abc, abc, abc]
say ~$<string>; # abc-abc-abc
say ~$<string><part>; # [abc, abc, abc]
}
Coercing the match object to a hash gives you easy programmatic access to
Expand Down Expand Up @@ -957,8 +957,8 @@ Whereas these two are not:
Brackets and parentheses limit the scope of an adverb:
/ (:i a b) c / # matches 'ABc' but not 'ABC'
/ [:i a b] c / # matches 'ABc' but not 'ABC'
/ (:i a b) c /; # matches 'ABc' but not 'ABC'
/ [:i a b] c /; # matches 'ABc' but not 'ABC'
=head3 X<Ratchet|regex adverb,:ratchet;regex adverb,:r>
Expand Down

0 comments on commit d730103

Please sign in to comment.