What are the potential drawbacks of using preg_match_all for extracting song lists from websites in PHP?

Using preg_match_all for extracting song lists from websites in PHP can be problematic because it relies on regular expressions, which can be complex and error-prone. Additionally, if the structure of the website changes, the regular expressions may need to be updated accordingly. A more robust solution would be to use a DOM parser like SimpleHTMLDom to extract the song lists, which is more reliable and easier to maintain.

// Using SimpleHTMLDom to extract song lists from websites
include('simple_html_dom.php');

$html = file_get_html('http://example.com/songs');
$songList = array();

foreach($html->find('ul.song-list li') as $song) {
    $songList[] = $song->plaintext;
}

print_r($songList);