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