September 2017
Beginner
402 pages
9h 52m
English
A very simple character, just a single dot, can match with any character in the string. This is often used when you do not care about some character between the two parts. For example, the following code will match with a string that has any two characters between a and d:
say 'OK' if 'abcd' ~~ / a . . d /; # OKsay 'OK' if 'aefd' ~~ / a . . d /; # OKsay 'OK' if 'a*^d' ~~ / a . . d /; # OK
In the first two examples, each dot matched one of the letters. In the third one, both dots matched with a whitespace.
Read now
Unlock full access