in reply to Matching a regular expression group multiple times

There is a mistake in the second section of code. It should read like this.
my $re = qr/(?:(simple).*?)+/; my $string = "This is a simple thing just a simple simple thing."; $string =~ /$re$re$re/g; say $1 if $1; # says simple say $2 if $2; # says simple say $3 if $3; # says simple