immutable regular expression: move this outside of the function. Also move the function declaration out of the each() call.