$str =~ s/([a-z]),/$repl/eeig; #### attempt 1 yields: aAcd