RegExp should be created outside the loop since valignCSS is constant throughout all iterations, rather than recreating it on each iteration.