Camelia
Prev: Reuse capture

Word boundary

examples/regex2/word_boundary.p6
use v6;

my $s = 'The elvish brown fox jumped over the the lazy dog';
# << and >> mark word boundary
if $s ~~ m/ << (\w+) \W+ $0 >> / {
    say $/[0];  # will print 'the'
}



Prev: Reuse capture

Table of Contents

Comments

In the comments, please wrap your code snippets within <pre> </pre> tags and use spaces for indentation.
comments powered by Disqus

Perl 6 Tricks and Treats newsletter

Register to the free newsletter now, and get updates and news.
Email:
Name: