loading
index.js
1
2
3
4
5
6
7
8
9
10
let hideEmails = function(string) {
    return string
      .replace(
        /[\w-][email protected][\w-]{2,}\.[\w-]{2,}/g, 
        '#####')
}

let exampleSentence = "I entered the e-mails [email protected] and [email protected] into our @store.com database.  The e-mail [email protected] was invalid so it was not entered."

console.log(hideEmails(exampleSentence))
node v10.16.0