Say I have some text like so:
Lorem Ipsum <a href="http://www.youtube.com/watch?v=E6USO8krrmU">http://www.youtube.com/watch?v=E6USO8krrmU</a> blah blah blah <a href="http://www.google.com" target="_blank">Google</a> it's hot outside <a href="http://www.youtube.com/watch?v=E6USO8krrmU" class="class1 class2">http://www.youtube.com/watch?v=E6USO8krrmU</a>
..and I want to remove the link from around it if the href attribute contains youtube - for the sake of this example.
The output should be:
Lorem Ipsum http://www.youtube.com/watch?v=E6USO8krrmU blah blah blah <a href="http://www.google.com" target="_blank">Google</a> it's hot outside http://www.youtube.com/watch?v=E6USO8krrmU
How can I achieve this?
While I have your attention, if anyone has any links to a good place to start learning regex I'd love to hear it.