View Single Post
Old 03-10-2012, 08:28 AM  
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,619
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
)
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


My Newest Theme
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote