for (j in 1:wildcards_nb){ #where wildcards_nb is the user's free parameter substr($regex, $i, 1) = '.'; push @regexes, $regex; }