Repair RegExp issue
see：http://stackoverflow.com/questions/1520800/why-regexp-with-global-flag-in-javascript-give-wrong-results
Merge pull request #17 from gin7758258/master

Repair RegExp issue