URL Regular Expression (Regex)

Here’s a regular expression to match URLs based on the RFC 3986. This example uses PHP.

[cc lang=”php”] $scheme = “(https?)://”;
$userinfo = ‘([“+a-z0-9-._~+”]+(:[“+a-z0-9-._~+”]+)[email protected])?’;
$host = ‘([([0-9a-f]{1,4}|:)(:[0-9a-f]{0,4}){1,7}((d{1,3}.){3}d{1,3})?]|[“+a-z0-9-+”]+(.[“+a-z0-9-+”]+)*)’;
$port = “(:d{1,5})?”;
$path = ‘(/(([“+a-z0-9-._~!$&’ . “‘()*+,;=:@+” . ‘]|”+%[0-9a-f]{2}+”)+)?)*’;
$query = ‘(?(([“+a-z0-9-._~!$&’ . “‘()*+,;=:@+” . ‘”/”+”?”+”]|”+%[0-9a-f]{2}+”)+)?)?’;
$fragment = ‘(#(([“+a-z0-9-._~!$&’ . “‘()*+,;=:@+” . ‘”/”+”?”+”]|”+%[0-9a-f]{2}+”)+)?)?’;
[/cc] Read More

Startups to Look Out For

Here are some startups I think have potential:

  • SendHub

Best Way To Transfer Money Overseas For Product Samples

This is a test post.

Different Types of CAPTCHA

Recently I needed to improve CAPTCHA on a website. Here are the different types of CAPTCHAs I found.

Personally, the CSS CAPTCHA is the most elegant since users won’t even see any CAPTCHA field.

Hello world!

This is a test. … Yep, it works 🙂

Documentary: Inside Job

Interesting documentary about the cause of the 2008 world economic crisis.

[youtube http://www.youtube.com/watch?v=FzrBurlJUNk]

How to update multiple rows and columns at once in a database table from a user-submitted form.