title: Why PostgreSQL return different result for simular regexp?
body: <p>I'm new in postgreSQL and facing a strange problem:</p>
  
  <p>Queries return different results for the same regular expression. How it this possible?</p>
  
  <p>And why do the first 3 queries return null when the last one returns the correct 'true'.</p>
  
  <p>I read the <a href="http://www.postgresql.org/docs/current/static/functions-matching.html" rel="nofollow">postgreSQL documentation</a> but still can't figure out where the difference is between those functions. </p>
  
  <p>Please help.</p>
  
  <pre><code>select '12340599' like '^[0-9]*$'
  select '12340599' similar to '^[0-9]*$'
  select substring('12340599' from '^[0-9]*$' for '#')
  select '12340599' ~ '^[0-9]*$'
  </code></pre>