aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-099/luca-ferrari/raku/ch-2.p618
1 files changed, 18 insertions, 0 deletions
diff --git a/challenge-099/luca-ferrari/raku/ch-2.p6 b/challenge-099/luca-ferrari/raku/ch-2.p6
new file mode 100644
index 0000000000..386d2fdfd4
--- /dev/null
+++ b/challenge-099/luca-ferrari/raku/ch-2.p6
@@ -0,0 +1,18 @@
+#!raku
+
+sub MAIN( Str $S, Str $T ) {
+ say "String [$S] with pattern [$T]";
+
+ my $counter = 0;
+
+ my $regexp = $T.comb.join( '.*' );
+
+ # overlapping search
+ given $S {
+ for m:exhaustive/ <$regexp> / -> $match {
+ $counter++;
+ }
+ }
+
+ say $counter;
+}