in reply to Re: Constructing a list of regexes
in thread Constructing a list of regexes

The following will work. There was another problem with your example. "(Jack) and (John)" the literal string, does not match itself as a pattern with capturing parentheses.
my $new_value='$2 and $1'; my $string="(Jack) and (John)"; my $regex=qr/$string/; $string = "Jack and John"; eval "\$string=~s/\$regex/$new_value/"; print $@ if $@; print "$string\n";