title: What should QString::contains(QRegExp) return? May I use position meta-characters within the RegExp?
body: <p>I'm trying to detect if my input is a URL or a plain file path. I'm simply checking for http:// or www within the string, and that's enough for me.</p>
  
  <p>So, I'm trying QString::contains(QRegExp) and I'm finding that it doesn't return what I expect it to. I've made a snippet to prove that it's bogus:</p>
  
  <pre><code>#include &lt;QtCore&gt;
  #include &lt;iostream&gt;
  
  int main(int argc, char *argv[]){
          std::cout &lt;&lt; "true: " &lt;&lt; true &lt;&lt; std::endl;
          std::cout &lt;&lt; "false: " &lt;&lt; false &lt;&lt; std::endl;
          if (argc &gt; 1)
                  std::cout &lt;&lt; "input: " &lt;&lt; (QString(argv[1]).contains(QRegExp("^[(http://)(www)]"))) &lt;&lt; std::endl;
          return 0;
  }
  </code></pre>
  
  <p>It should print 0 if the first parameter does not begin with www or http://, or 1 if it does. But, this are my results:</p>
  
  <pre><code>$ ./test
  true: 1
  false: 0
  $ ./test foobar
  true: 1
  false: 0
  input: 0
  $ ./test www.google.com
  true: 1
  false: 0
  input: 0x7fffa68f72df
  $ ./test ww_foobar.com
  true: 1
  false: 0
  input: 0x7fff177ba65f
  </code></pre>
  
  <p>Does anyone know what is going on?</p>