мне нужно чтоб здесь вывелось "card, s, s" и всеstr.replace(reg, (sp, match) => { console.log(sp,match) // card, s, s })
const str = "card's ff bal s fdfgbal dkjgkjsff others";
const reg = new RegExp('(card).*(s).*(s)', 'g');
str.replace(reg, (match, p1, p2, p3, offset, string) => {
console.log(match, p1, p2, p3, offset, string)
})
(?![@param*])((?:"[^"]+")|(?:[\S]+))
(?![@param*])((?:"(?:(?:\\")|(?:[^"]))+")|(?:[\S]+))