diff options
author | Patrick Spek <p.spek@tyil.nl> | 2018-10-23 07:55:02 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2018-10-23 07:55:02 +0200 |
commit | 9e54ebdd2a61865c1f48b1279995e6964ab8daa2 (patch) | |
tree | 32656eaf6d5860624f0db57c4130c169d7f35412 /_posts | |
parent | 9687d86e8e81bce5b01e96172405ac585a939e64 (diff) |
Use full adverb in count-substring
Diffstat (limited to '_posts')
-rw-r--r-- | _posts/2018-10-11-hackerrank-solutions-python3-and-perl6-part-2.html | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/_posts/2018-10-11-hackerrank-solutions-python3-and-perl6-part-2.html b/_posts/2018-10-11-hackerrank-solutions-python3-and-perl6-part-2.html index 92f4dc0..6bad7cb 100644 --- a/_posts/2018-10-11-hackerrank-solutions-python3-and-perl6-part-2.html +++ b/_posts/2018-10-11-hackerrank-solutions-python3-and-perl6-part-2.html @@ -257,7 +257,8 @@ read, in my opinion. <div class="language-defender"> <div class="language-code"> -{% highlight perl6 tio=https://tio.run/##K0gtyjH7/7@4NEkhOb80r0QXyCouKcrMS1fQUIEwdBRUgIK6EI6mQjUXZ2pOam6xAlRaoa5OIdcqv0wfSZU@V@1/NOM0VLQ8/fTSU0uAxkFZmnrFiZX/HZ2cXYCQC4gB %} +{% highlight perl6 +tio=https://tio.run/##K0gtyjH7/7@4NEkhOb80r0QXyCouKcrMS1fQUIEwdBRUgIK6EI6mQjUXZ2pOam6xAlRaoa5OIdcqvwxoUGKBPpJSfa7a/2hmaqhoefrppaeWAM2EsjT1ihMr/zs6ObsAIRcQAwA %} sub count-substring ($string, $sub-string) { elems $string ~~ m:overlap/$sub-string/ } @@ -269,8 +270,8 @@ sub count-substring ($string, $sub-string) { {% markdown %} The Perl 6 version makes use of some regex magic, and the `elems` subroutine. `elems` returns the number of elements in a list, which in this case would be -the number of matches found by the regex. The `m:ov//` makes a regex to -*m*atch, with *ov*erlapping strings. +the number of matches found by the regex. The `m:overlap//` makes a regex to +*m*atch, with *overlap*ping strings. {% endmarkdown %} </div> |