es6 regex update

Some adjustments to the regex and updates for latest syntax. This should be a fix for #239.