Hello! I ask for your help. There is a line with html code that looks like this.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>***@conference.***.us - 25.06.2017</title> <!-- <link rel="stylesheet" type="text/css" href="../../../css/chatlogs.css"/> --> <style type="text/css"> <!-- ///.... </style> </head> <body> <div style="text-align: right;"> <a style="color: rgb(170, 170, 170); font-family: monospace;" href="../../../">Home</a> </div> <div class="roomtitle">tulpae-flood</div> <a class="roomjid" href="xmpp:***@conference.***.us?join">***@conference.***.us</a> <div class="logdate">25.06.2017<span class="w3c"><a class="nav" href="../../2017/06/24.html"><</a> <a class="nav" href="./">^</a> <a class="nav" href="../../2017/06/26.html">></a></span> </div> <br/> ... <a name="00:00:00" href="#00:00:00" class="ts">[00:00:00]</a> <span class="mn"><Nick></span> " Шаблон " <br> <a name="00:01:00" href="#00:01:00" class="ts">[00:01:00]</a> <span class="mn"><Nic2></span> " Шаблон2 " <br> <a name="09:43:11" href="#09:43:11" class="ts">[09:43:11]</a> <span class="mn"><Hankl& Blr></span> О, Навка, Навка! <br/> I am trying to write a regular expression that would search for the word (n, m) (a, i) vka between <span> and <br> , capturing the <a> tags as well.
Such an attempt was not crowned with success:
preg_match_all("/<a name=\"(.*?)\" href = \"(.*?)\" class=\"ts\"> (.*?) </a> <span class=\"mn\"> (.*?) </span> (Н|М)(а|я)вк.*?/i", $html, $search); I would be very grateful if someone responds and prompts!