Replaced the regExp and added a foreach loop. Removed style

https://github.com/GigaOM/gigaom/issues/5083
spacing after `if` and brace style.