D
D
Dwellss2021-06-27 21:21:26
Regular Expressions
Dwellss, 2021-06-27 21:21:26

How to adapt this simple regexp to line breaks?

Friends, I really hope that the issue is simply resolved :)
There is a regsp that removes the active link, leaving the anchors:

<a([^>]+)>(.*)</a>
меняем на $2

and get from the source code
<a title="sites" target="_blank" href="https://www.siterere.com/me.php"> <font color="#B0B0B0" size="2" face="Arial">Siterer</font></a>

like this:
<font color="#B0B0B0" size="2" face="Arial">Siterer</font>

It's perfect. But! If the link tag spans several lines, then the specified regexp no longer finds the link, i.e. he does not see the link in this code:
<a title="sites" target="_blank" href="https://www.siterere.com/me.php">
              <font color="#B0B0B0" size="2" face="Arial">Siterer</font>
              </a>

Is it possible to somehow fix it so that the regsp looks not only within the boundaries of one line, but also several lines further?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question