`.` is a special character in regular expressions, it means "anything" :) You should escape it with a backslash : 

` const DATA_URI_REGEXP = '/data:([a-zA-Z-\/]+)([a-zA-Z0-9-_;=\.]+)?,(.*)/'`