Code:
<?php
$html = '<h1 class="video-title one two clearfloat">get this</h1>';
$raymor_regex = '/<h1 class="video-title([^>]*)\">([^<]*)<\/h1>/';
$brujah_regex = '/<h1 class="video-title[^"]+">([^<]+)/';
$mikke_regex = '/<h1 class="video-title\s+(.*?)">(.*?)<\/h1>/i';
preg_match($raymor_regex,$html,$raymor);
preg_match($brujah_regex,$html,$brujah);
preg_match($mikke_regex,$html,$mikke);
echo "raymor \n\n";
print_r($raymor);
echo "brujah \n\n";
print_r($brujah);
echo "mikke \n\n";
print_r($mikke);
these are the results
Code:
raymor
Array
(
[0] => <h1 class="video-title one two clearfloat">get this</h1>
[1] => one two clearfloat
[2] => get this
)
brujah
Array
(
[0] => <h1 class="video-title one two clearfloat">get this
[1] => get this
)
mikke
Array
(
[0] => <h1 class="video-title one two clearfloat">get this</h1>
[1] => one two clearfloat
[2] => get this
)