Ошибка полосы «Uncaught TypeError: Не удается прочитать свойство« result »из null»
Вы можете использовать:
var arr = [],
re = /:([^ :]+):/g,
input = "I went to :Rome: last night, now I'm in :Florence:";
while ( m=re.exec(input) )
arr.push(m[1]);
console.log(arr);
//=> ["Rome", "Florence"]