It is the $regex which gets recompiled.
In reply to Re^2: Performance of assambled regex by shmem in thread Performance of assambled regex by Foodeywo