Regex fixed

I've improved the Regex as discussed in #7. I've also used newlines instead of spaces for JavaScript's automatic semicolon insertion (ASI).