function getVersionRegexp({ key, version }) {
  return new RegExp(`${key}['|"]?\\s*:\\s*[\\\]?['|"]?${version}`);
}
gets the version key and the version and generates a regular expression that
could be used to match with any content
@param {*} key could be 'openapi' or 'swagger' depending on the version of
provided spec
@param {*} version could be 2. or 3. depending on the provided spec
@returns {object} the resultant regular expresion using the provided data