browse by category or date

I need to have a good regex for URL validation in javascript. After googling a number of websites, blogs and forums. The best I found is this blog post by Ivan Porto Carrero

I modified it a bit to make it valid in Javascript as shown below:

twitTxt = twitTxt.replace(/((ht|f)tp(s?)\:\/\/|~\/|\/)?(\w+:\w+@)?(([-\w]+\.)+(com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel|[a-z]{2}))(:[\d]{1,5})?(((\/([-\w~!$+|.,=]|%[a-f\d]{2})+)+|\/)+|\?|#)?((\?([-\w~!$+|.,*:]|%[a-f\d{2}])+=([-\w~!$+|.,*:=]|%[a-f\d]{2})*)(&([-\w~!$+|.,*:]|%[a-f\d{2}])+=([-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(#([-\w~!$+|.,*:=]|%[a-f\d]{2})*)?/, twitRegexCallback);

If you like it, a link back/comments would be much much appreciated 🙂

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant:

Got this image from Hacker News, originally located here.

It’s something that we need to always remember, that we are as human, is really really nothing in this universe.

Where do we stand in Universe?

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Identity Crisis?

Today I received an email from a Cisco Distributor in Jakarta. The email was a quotation of Cisco 24-Port Gigabit Switches. The email also indicated that the switch will be used in Indonesian Ministry of Health. Each model of the switch listed has two prices, list price and reseller price. The reseller price is lower by about $100 compared to the list price. I assume the dollar sign is for US Dollar (USD).

It is interesting to note that it seems computer equipments in Jakarta are traded in USD, not Indonesian Rupiah (IDR). Perhaps the instability of IDR exchange rate to USD (or other currency for that matter) makes it safer for the suppliers to trade their goods in USD.

Anyway, I think this is definitely a case of mistaken identity. So I immediately replied to the sender, telling him that he got the wrong email address. The sender then later on replied apologizing for the mistake.

Problem solved, but I can’t help to be curious to find out which ‘Hardono‘ that actually requested the quotation. Hardhono, was it you? 🙂

*) This Hardono has never physically met any other Hardono. The closest he got was having a roommate called Yandhie Dono

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant: