define (VERSION, '5.0 dev'); preg_match('/DRUPAL-'. substr(VERSION, 0, strpos(VERSION, '.')) .'(?:--(\d+)(?:-(\d+))?)?/', $ver, $matches); var_dump($matches);