<?php $string = '12-34-56-78'; $pattern = '/^\d{2}(?|(-)|(---)|(\.)|(\:))\d{2}\1\d{2}\1\d{2}$/'; $matches = preg_match($pattern, $string) === 1; var_dump($matches);
You have javascript disabled. You will not be able to edit any code.