Course of Raku / Regexes and grammars / Regexes / Substitution and replacement / Exercises

Censor a word

Problem

Take the string 'secret secret plan' and replace every occurrence of the word secret with ***. Print the changed string.

Example

The program prints:

*** *** plan

Solution

See the solution

Course navigation

Quiz — Substitution   |   Solution: Censor a word