how it is getting this value in reg exp for php <li><b>Paperback:</b> 367 pages</li> i need only "367" i am using strpos and substr but now i want in regExp... thanks
if (preg_match('%Paperback:</b>\s*([0-9]+)\s+pages%s', $str, $matches)) { echo "matched $matches[1]\n"; } else { echo "didn't match\n"; }
if (preg_match('/\d+/', '<li><b>Paperback:</b> 367 pages</li>', $matches)) { echo $matches[0] . "\n"; } else { echo "didn't match\n"; }