The Hound of the Wolf

For the strength of Pack is in the Wolf, and the strength of Wolf is in the Pack -Rudyard Kipling

Saturday, January 13, 2007

Hacking JS regular expressions

Hindi talaga ako fan ng regular expression. Kahit sa automata class, isinusuka ko ito.Kundi nga lang sa isang requirement, di ako ma-appreaciate ito ng lubusan. Napakahalaga ng form validation sa client-side using javascript para makabawaw ng error-check sa server. I am glad to finally implement a not so complex regex in JS dahil most of the filtering I am used to are in PHP (server-side).

tID = /^[0-9]{3}-[0-9]{2}-[0-9]{3}[^IO(a-z)]{1}$/;

What a way to end a day. Buong araw ko ito inisip....