Saturday, February 12, 2005

RE (Regular Expressions) Which Need To Memorize (Remeber, rem IT)

Dear All, Something very tiny, but everyone needs it time by time, so dont forget to have it all in your toolBox. And this is RE's (Regular Expression), especially when you are validating input, like validating numerics, alpha, alphanumeric, email address, etc. Some of the most common are as below. For Numeric, use : ^[1234567890]* For Alpha Numeric, use : ^[_A-Za-z0-9 ]* For Alpha, use : ^[_A-Za-z ]* For Email, use : \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* Just parse input data with these RE's and get your code ready to have a showcase :) Remember in prayers, Wajahat Abbas


Post a Comment

<< Home