Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

19 lines (17 sloc) 0.669 kB
const s = "this is a @cool link from @starbucks check it here http://bit.ly/cool"
s.replace()
s.replace(//,"__")
s.replace(/\w+/,"__")
s.replace(/\w+/g,"__")
s.replace(/\S+/g,"__")
s.replace(/http\S+/g,"__")
s.replace(/http\S+|@\w+/g,"__")
s.replace(/http\S+|@\w+/g,"__")
const s = "this is a #cool #link from @starbucks check it here http://bit.ly/cool"
const d = "this is a #cool #link from @starbucks and @macdonalds check it here http://bit.ly/cool"
d
d.replace(/http\S+|@\w+/g,"__")
d.replace(/http\S+|@\w+|#\w+/g,"__")
d.replace(/(http|https)\S+|@\w+|#\w+/g,"__")
d.replace(/(http|https)\:\S+|@\w+|#\w+/g,"__")
d.replace(/(http|https)\:\/\/\S+|@\w+|#\w+/g,"__")
Jump to Line
Something went wrong with that request. Please try again.