Ошибка полосы «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"]
0
задан Mav Developer 16 January 2019 в 10:06
поделиться