Pages - Menu

Sunday, September 15, 2013

Regular Expressions || Oracle ADF

Hi
today i give a short Article about effect of Regular Expressions in Oracle ADF World..
regular Expression provides a concise and flexible means to “match" Strings of text, and we can say it is the art of "How to work with Strings" ..
Why we need regular expression ?
Answer : Match & Validation of Strings, as many times, Developers find a challenge to Validate or Search in Strings and using normal Programming Concepts using a method to make the operation is a big false with bad performance and big efforts from Developers and so we are hear to speak about Regular Expressions.
Example : many of Projects contains a notifications with type SMS & Emails and sometime Faxes, so we have to be sure from theses keys used to send theses types of notifications, so Regular Expressions is the best way here.
Now i give some Regular Expressions to use in Validating E Mails, FAX,Mobile No & Phone No
Note : i work with Saudi Arabia Service Providers ..
- Saudi Service Providers - Mobily,STC & ZAIN
  • Mobily : [+966]{4}+[54 or 56]{2}+[0-9]{7}
  • STC      : [+966]{4}+[50 or 55]{2}+[0-9]{7}
  • ZAIN    : [+966]{4}+[58 or 59]{2}+[0-9]{7}
  • Land Line : [+966]{4}+[1 or 2]{1}+[0-9]{7}   — Riyadh & Jeddah City
  • FAX           : [+966]{4}+[1 or 2]{1}+[0-9]{7}   — Riyadh & Jeddah City
  • EMAIL       : [A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}
and Now, you can see a a magic in your ADF application, as you can make a declarative Validation in Entity Objects with type Regular Expression and use above simple scripts to validate your Attributes of type Email, FAX, Phone & Mobile

No comments:

Post a Comment