getApplicationDir() . DIRECTORY_SEPARATOR . 'VERSION' ))) { return false; } $matches = array(); if (false === ($res = preg_match( '/(?\w+)(?:\s*\(.*?(?:(?<=[\(,])\s*tag\s*:\s*v(?P.+?)\s*(?=[\),]).*?)?\))?\s*(?P\S+)/ms', $appVersion, $matches )) || $res === 0) { return false; } foreach ($matches as $key => $value) { if (is_int($key) || $value === '') { unset($matches[$key]); } } return $matches; } }