title: use of colon symbol in regular expression
body: <p>I am new to regex. I am studying it in regularexperssion.com. The question is that I need to know what is the use of a colon (:) in regular expressions.</p>
  <p>For example:</p>
  <pre><code>$pattern = '/^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&amp;amp;?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/';
  </code></pre>
  <p>which matches:</p>
  <pre><code>$url1  = &quot;http://www.somewebsite.com&quot;;
  $url2  = &quot;https://www.somewebsite.com&quot;;
  $url3  = &quot;https://somewebsite.com&quot;;
  $url4  = &quot;www.somewebsite.com&quot;;
  $url5  = &quot;somewebsite.com&quot;;
  </code></pre>
  <p>Yeah, any help would be greatly appreciated.</p>