How can the user modify the regex pattern to accurately capture the desired output?

The user can modify the regex pattern by adding a quantifier to the character class for digits to capture multiple digits. By adding a "+" symbol after "\d", the pattern will match one or more digits in a row. This will ensure that all consecutive digits are captured in the output.

$input = "abc123def456ghi";
preg_match_all("/\d+/", $input, $matches);
print_r($matches[0]);