/(\|\|description\|[^|]+\|\|)/
<?php
$string = 'poster|text||title|text||title_en|text||year|2020||description|тут могут быть любые символы||countries|text||genres|text|| .....';
preg_match('/(\|\|description\|[^|]+\|\|)/', $string, $matches);
var_dump($matches[1]);
document.querySelectorAll('ul li a').forEach((link, index) => {
link.addEventListener('click', () => {
console.log('Index is', index);
});
});
document.querySelectorAll('a').forEach(link => {
link.addEventListener('click', event => {
const parent = event.target.closest('li');
if (parent !== null) {
const items = [...parent.parentElement.children];
const index = items.indexOf(parent);
console.log('Index is', index);
}
});
});