H
H
Hanry6542020-07-18 21:16:46
JavaScript
Hanry654, 2020-07-18 21:16:46

Why doesn't this regular expression work in javascript?

var message = "!test vk.com/123";
var re = /^!test (\[\S+?\|@|\[\S+?\|\*|(https:\/\/|)vk.com\/)\S+$/i;
var search = message.replace(re, "");
search.replace(/[\[\]\*@]/g, "");

console.log(search); // пустая строка

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question