function paymentCard() {
if ($('#paymentCard').val() === "") {
return '<?= lang("not_completed")?>';
} else {
const str = $('#paymentCard').val();
const regex = /(?<=\d{4})\d(?=\d{4})/gm;
const subst = `*`;
return str.replace(regex, subst);
}
}
return str.replace(/^(\d{4})(\d+)(\d{4})$/, (m, p1, p2, p3) => p1 + '*'.repeat(p2.length) + p3);