You can interpolate in a regex literal just fine: `/#{link_pattern}$/`. I wonder if you meant end of string `/\Z/` here?