Longest palindromic substrings: Difference between revisions

m
m (→‎{{header|Raku}}: Other micro optimizations. Fix edge case error)
Line 445:
=={{header|Raku}}==
{{works with|Rakudo|2020.09}}
This version regularizes (ignores) case and ignores non alphanumeric characters. It is only concerned with finding the ''longest'' palindromic substrings so does not exhaustively find ''all possible'' palindromes. If a palindromic substring is found to be part of a longer palindrome, it is not captured separately. Showing the longest 5 palindromic substring groups. Run it with no parameters to operate on the default; pass in a file name to run it against that instedinstead.
 
<lang perl6>my @chars = ( @*ARGS[0] ?? @*ARGS[0].IO.slurp !! q:to/BOB/ ) .lc.comb: /\w/;
10,333

edits