in reply to returning variable from within regex
elsif($var1=~ /[$var2]([a-z])/) { #stuff with $1 } [download]
but it's hard to say.