Regexp jetzt testen | Projekt zurücksetzen
$pattern = "/(?:[\d]{3}[-\s\.])?[\d][-\s\.][\d]{3,5}[-\s\.][\d]{3,5}[-\s\.][\d]/"; $string = "ISBN 978-3-87318-556-2 ISBN 978.3.87318-556.2 ISBN 3-540-43558-1"; preg_match_all ( $pattern, $string, $output );
$output = Array ( [0] => Array ( [0] => 978-3-87318-556-2 [1] => 978.3.87318-556.2 [2] => 3-540-43558-1 ) )