input: Write a Python function to extract and validate repository URLs using regular expressions.
  assert repoObject('https://github.com/user/repo.git') == {'type': 'git', 'url': 'https://github.com/user/repo.git'}
  assert repoObject('hg+https://example.com/repo') == {'type': 'hg', 'url': 'hg+https://example.com/repo'}
  assert repoObject('svn+https://example.com/repo') == {'type': 'svn', 'url': 'svn+https://example.com/repo'}
  assert repoObject('invalid_url') == None
output: def repoObject(url):
      import re
      
      patterns = {
          'git': r'^(https:\/\/|git@|git:\/\/)?(github\.com|bitbucket\.org|gitlab\.com)\/.*\.git$',
          'hg': r'^hg\+https:\/\/.*$',
          'svn': r'^svn\+https:\/\/.*$'
      }
      
      for repo_type, pattern in patterns.items():
          if re.match(pattern, url):
              return {'type': repo_type, 'url': url}
      
      return None