Course of Raku / Regexes and grammars / Regexes / Adverbs / Exercises / Case-blind match

Solution: Case-blind match

Here is a possible solution to the task.

Code

say 'Hello WORLD' ~~ /:i world/;

🦋 You can find the source code in the file case-blind.raku.

Output

「WORLD」

Comments

  1. The :i adverb makes the match ignore the difference between upper- and lower-case letters.

  2. The lower-case pattern therefore matches the upper-case WORLD.

Course navigation

Case-blind match   |   Count the matches