find and replace in javascript using regex