bugfix: use same regexp variable in both phases of update (was only first)