Add a second var
Remove the extra space
Save the regexp in the outer scope so it's not compiled every time this function runs