can you help me, I tried so many options but I'm still unable to get it working. I have this regex
/(?<startSearch>24510<\/td>.+\n).+(\|a(?<title>.+)){0,1}(\|b(?<subtitle>.+)){0,1}(\|c(?<author_info>.+)){0,1}(?<endSearch><\/td>)/u
and the website page in variable, which contains following:
<tr valign=top>
<td class=td1 id=bold width="10%" nowrap>24510</td>
<td class=td1>|a První kroky z deprese / |c Sue Atkinson ; [z angličtiny přeložil Jindřich Kotvrda]</td>
</tr>
As you can see on test in link above, I'm able to capture startSearch and endSearch group, but not others (title, subtitle, author_info), which each of them is inside optional groups (agroup, group,cgroup).
Expected output of this example should be:
$match['title'] = ' První kroky z deprese / '
// $match['subtitle'] is not in here, because it doesn't exist in the example
$match['author_info'] = ' Sue Atkinson ; [z angličtiny přeložil Jindřich Kotvrda]'
Are you able to find, where is the problem and show me the solution, please?
EDIT: OK, I rewrote it for SimpleHtmlDom and going through by DOM traversing. Bet there is still the main issue with Capturing groups... I updated the link with new text, which I got from DOM and updated Regex syntax, but it is still not working. It is taking whole text as agroup.