#!/usr/bin/perl # https://perlmonks.org/?node_id=1227147 use warnings; use strict; my $pattern = 'FTTF'; my $repeated_pattern = $pattern x ( 1 + ( map $_, 0 .. 12 ) / length $ +pattern ); my @result = grep { $repeated_pattern =~ /./g; $& eq 'T' } 0 .. 12; print $repeated_pattern, "\n"; print "@result\n";
In reply to Re^2: Grep Pattern
by rsFalse
in thread Grep Pattern
by GotToBTru
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |