Hello!
Suppose there is a text:
<link rel="stylesheet" href="/css/style.css" type="text/css" /> <div class="custom"> <p><a href="/" title="IP-телефония"><img src="/images/logo2-2-fixed-mini-3.png" alt="IP-телефония" width="175" height="44" /></a></p> <p><a href="/news" title="IP-телефония"><img src="/logo2-2-fixed-mini.png" alt="IP-телефония" width="175" height="43" title="IP-телефония" /></a></p> <img src="/images/24.jpg"> </div> You need to extract the path to the file with the name of the file itself. Files may have different extensions.
That is, the output should be the following:
- href = "/ css / style.css"
- src = "/ images / logo2-2-fixed-mini-3.png"
- src = "/ logo2-2-fixed-mini.png"
- src = "/ images / 24.jpg"
My regular work is crooked (captures everything until it finds the file extension).
/(href|src)=".*(\.png|\.js|\.css|\.jpg)"/U It turns out like this:
href="/" title="IP-телефония"><img src="/images/logo2-2-fixed-mini-3.png" Thanks in advance for your help!