$re = '~\b(\d*d[/x+\d]+)\b~';
$str = '
d6: Roll a single 6-sided die.
3d6: Roll 3 dice of 6-sides each and find the sum.
4d6+1: Roll 4 dice of 6-sides each, and add 1 to the sum.
3d6x10: Roll 3 dice of 6-sides each, then multiply the sum by 10.
d6/2: Roll a 6-sided die and then divide by 2 (rounding up).
';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php