multi can-spell-word(Str $word, @blocks) { my @regex = @blocks.map({ my @c = .comb; rx/<@c>/ }).grep: { .ACCEPTS($word.uc) } can-spell-word $word.uc.comb.list, @regex; } multi can-spell-word([$head,*@tail], @regex) { for @regex -> $re { if $head ~~ $re { return True unless @tail; return False if @regex == 1; return True if can-spell-word @tail, list @regex.grep: * !=== $re; } } False; } my @b = ; for { say "$_ &can-spell-word($_, @b)"; }