Posted by: wajahatabbas | 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


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: