- Integer (positive and negative)
- ^[+-]?\d+$
- ^[+-]?[0-9]+$
- Matches: any signed integer
- Integer (positive)
- ^[0-9]+$
- Matches: any positive signed integer
- Integer (negative)
- ^[-][0-9]+$
- Matches: any negative signed integer
- Decimal (positive and negative)
- ^[-+]?\d+(\.\d+)?$
- ^[+-]?[0-9]*(?:\.[0-9]*)?$
- Matches: 123 | -123.45 | +123.56
- Decimal (positive)
- ^[+]?[0-9]*(?:\.[0-9]*)?$
- Matches: 123 | 123.45 | +123.56
- Decimal (negative)
- ^[-][0-9]*(?:\.[0-9]*)?$
- Matches: -123 | -123.45 | -123.56
- Number (positive and negative)
- ^[+-]?([0-9]*\.?[0-9]+|[0-9]+\.?[0-9]*)([eE][+-]?[0-9]+)?$
- Matches: 23 | -17.e23 | +.23e+2
- Natural Number
- ^[0-9]*[1-9]+$|^[1-9]+[0-9]*$
- Alphabetical
- [^a-zA-Z]
- Matches: ABC | Test | xyz
- Alphanumeric
- [^a-zA-Z0-9]
- ^[a-zA-Z0-9_]*$
- Matches: ABC | Test123
- E-Mail
- ^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$
- Matches: AhmedNegm@WindowsLive.com
- Date
- ^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))|^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d+$
- Matches: this expression validates a date field in dd/mm/yyyy and mm/dd/yyyy format
- Temperature
- ^[-+]?\d*(\.\d+)?( )?(Celsius|C|c|CELSIUS|Fahrenheit|F|f|FAHRENHEIT|Kelvin|K|k|KELVIN)?$
- Matches: 34F | 56 Celsius | 22C
- Egyptian National ID
- (2|3)[0-9][1-9][0-1][1-9][0-3][1-9](01|02|03|04|11|12|13|14|15|16|17|18|19|21|22|23|24|25|26|27|28|29|31|32|33|34|35|88)\d\d\d\d\d
- Egyptian Mobile Number
- (201)[0-9]{9}
- Hexadecimal String
- ^[0-9A-Fa-f]+$
- Matches: 062706440644064700200623064306280631
Category Archives: Common
Regular Expressions Patterns
World Countries Details!
Find the following Excel file which contains all public details about world countries, you will get:
- ISO3166 Alpha 2 .. like EG
- ISO3166 Alpha 3 .. like EGY
- ISO3166 Number 3 .. like 818
- English Name .. like Egypt
- Local Name .. like Mişr
- Local Long Name .. like Jumhūrīyat Mişr al ‘Arabīyah
- English Capital Name .. like Cairo
- Local Capital Name .. like Al Qāhirah
- Continent .. like AF
- Demomyn .. like Egyptian
- Latitude .. like 27
- Longitude .. like 30
Click Countries to download the file or get it from my dropbox.
Microsoft Exam .. 100% Free!! (EXPIRED!)
I’m Microsoft Certified Trainer (MCT), I can help you to get a free exam voucher for any of Microsoft exams.
Just send me your:
- First Name
- Last Name
- Microsoft Mail
Kindly, don’t do that unless you need to leave others to get the chance, reply on the same thread with the requested details and after registration you will get an email contains all of details which you want.
Notes:
- You’ve the chance to get one voucher only.
- You should use it before November 30, 2014.
- You cannot sell it, because it is assigned to you.
- Don’t use different mail to get more than one voucher, because of your records will be distributed on more than one transcript, it’s illegal issue.
- There’re limited seats, hurry up!
- Feel free to contact me (a.negm@outlook.com) if you want to get further info about the issue.
10 Reasons why your employees hate you!!
Firstly, this topic is copied from here, and I know that it isn’t related to our blog major trend, but it is so important for you in your work environment.
In the world of employees, a good boss is differentiated from a bad boss by the way the boss makes the employees feel. They also assess the boss based on his or her contribution – or lack thereof – to their ability to get their jobs done successfully.
Employees tolerate a lot of bad boss behavior. Many bosses are untrained, uncaring, and not held accountable for their actions and interaction with employees. Some were promoted to jobs above their competence to perform. Bad management practices weigh heavily in whether your employees hate you.
Windows 8: The End of the Beginning
As sure as day follows night, as sure as eggs is eggs and as sure as every odd-numbered Star Trek movie is shit… ~ Simon Pegg, Spaced
That was the rule: every odd-numbered Star Trek movie sucked. Star Trek: The Motion Picture was weak; Wrath of Khan was awesome; Search for Spock was abominable; The Voyage Home seemed better at the time than it does now; the Final Frontier may as well have had Captain Kirk in a leather jacket water-skiiing over a circling fin; The Undiscovered Country was clever and well written; Generations was just… weird; First Contact was a brilliant showing for the TNG crew; Insurrection was very, very dull. Then Nemesis, the tenth film, tried to ruin the whole thing by being possibly the suckiest Star Trek film ever. But that didn’t disprove the rule, which stated that the odd-numbered movies sucked, not that the even-numbered ones didn’t. And then JJ Abrams came along and rebooted the franchise, with a movie that is either number 11 or number 1 but is definitely odd-numbered either way, and is utterly fantastic.
So now I keep seeing tweets and blog posts and articles in journals I respect expressing the worry that Windows 8 is going to be “another Vista” or “another ME”, as though there were a rule that every other Windows release has to be a turkey. Thus I am compelled to post this, by way of respectful disagreement with these idiots. I’ll get onto why I don’t think Windows 8 is, or will be, a failure, but I’ll start by asking this question: