removed unneeded global attribute for a regex match and added comment