Substitute all words following a pattern in javascript : Given the string below

    "Hello this is a :sample string :hello"

i want to substitute :sample and :hello with something else.

How can i do this in javascript?