Updated version
Added g modifier for JavaScript RegExp