Regex in JS not working, but working in PHP

Printable View