Answer the question
In order to leave comments, you need to log in
How to apply a regular expression in a string?
Yesterday I was prompted with my question how to "wrap" the image link with other tags.
The original text is like this
<img src=""555.jpg"" />
<img src=""666.jpg"" />
<img src=""777.jpg"" />
<a href="555.jpg"><img src=""555.jpg"" /></a>
<a href="666.jpg"><img src=""666.jpg"" /></a>
<a href="777.jpg"><img src=""777.jpg"" /></a>
<img src=\"(.*)\" \/>
<a href="\1"><img src="\1" /></a>
<p><img src=""555.jpg"" /></p><p><img src=""666.jpg"" /></p><p><img src=""777.jpg"" /></p>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question