quote / /

Documentation for quote / / assembled from the following types:

language documentation Regexes

From Regexes

(Regexes) quote / /

Perl 6 has special syntax for writing regexes:

m/abc/;         # a regex that is immediately matched against $_ 
rx/abc/;        # a Regex object 
/abc/;          # a Regex object 

For the first two examples, delimiters other than the slash can be used:


Note that neither the colon : nor round parentheses can be delimiters; the colon is forbidden because it clashes with adverbs, such as rx:i/abc/ (case insensitive regexes), and round parentheses indicate a function call instead.

Whitespace in regexes is generally ignored (except with the :s or, completely, :sigspace adverb).

Comments work within a regular expression:

/ word #`(match lexical "word") /