- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
- preg_replace: documentation ( source)
<?php
$string = 'Blablabla Beginning Text <u>\\n\\\\*HYPERLINK \\"http://www.youtube.com/watch?v=A0VUsoeT9aM\\"1.A Youtube Video</u> blablabla Text Middle <u>\\n\\\\*HYPERLINK \\"http://www.youtube.com/watch?v=A0VUsoeT9aQ\\"2. A Youtube Video</u> blabla Text after';
$newpattern = '/(http[?.:=\w\d\\/]*)\\\\"([\s\w.]+)</';
print "does the pattern work?\n";
preg_match_all($newpattern, $string, $allMatches);
var_dump($allMatches);
print "yep!\n\n";
$newReplace = '<a href="\\1">\\2</a>';
var_dump( preg_replace($newpattern, $newReplace, $string) );