title: Regexp to grab protocol from URL
body: <p>Let's say I have a variable called URL and it's assigned a value of <code>http://www.google.com</code>. I can also received the URL via ftp, hence it'll be <code>ftp://ftp.google.com</code>. How can I have it so I grab everything before the <code>:</code>? I'll have an if/else condition afterwards to test the logic.</p>