title: How to verify valid format of URL as a git repo?
body: <p>I do NOT want to check if the remote repository exists.  I just want to test a string and return true if the string is in the valid format for a git repo.</p>
  
  <p>I'm writing a groovy script and wish to do a quick check if a string represents a valid possible git repo.</p>
  
  <p>For instance if the following strings are entered the test should return true:</p>
  
  <pre><code>http://example.com/my-project.git
  file:///absolute/path/to/my-project.git
  ssh:user@example.com:my-project
  my-project
  </code></pre>
  
  <p>The following strings should fail the test and cause false to be returned:</p>
  
  <pre><code>fil://example.com/my-project.git
  ssh:user|example.com:my-project
  </code></pre>
  
  <p>I'm hoping there is a git command that can do this quick test for me and I can call git from the groovy script.  I say this because I'd like to use whatever is compiled into git to do the test as opposed to re-implementing the regular expression (or parser) that already exists in git.  If I try the latter then inevitably I'll miss something.</p>