In what scenarios would it be necessary to consider additional characters or patterns beyond "DI" when extracting specific information from a string in PHP?

When extracting specific information from a string in PHP, it may be necessary to consider additional characters or patterns beyond just "DI" if the information you are looking for can vary in structure or format. For example, if you are trying to extract a phone number that can be in different formats like (123) 456-7890 or 123-456-7890, you would need to consider additional characters or patterns to accurately extract the phone number.

$string = "Phone numbers: (123) 456-7890 and 123-456-7890";
preg_match_all('/\(?(\d{3})\)?[-\s]?(\d{3})[-\s]?(\d{4})/', $string, $matches);

foreach($matches[0] as $match){
    echo $match . "\n";
}