Here is another useful post but after a long time. I am not getting time these days :( anyway.. here we go;
A lot of checking and validations can be easily performed by using regular expressions (I use it extensively and trust me they are very useful). Here I am posting some commonly required regex:
1. Regex for checking valid email id:
^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$
2. Regex for checking password policy
((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20})Here, we are checking that the password should contain atleast 1 digit, atleast 1 lower case char, atleast 1 uppercase char and atleast 1 special char from @,#,$ and %
3. Regex for valid IPv4 IP address
^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.
([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$
Enjoy
1 comment:
Cartier, Celine, Chanel, Chloe, Christian Dior, Christian Louboutin, Coach, Dior Homme, Dolce & Gabbana, Fendi, Giuseppe Zanotti, Givenchy, Gucci, Hermes, Jimmy Choo, Lancel, Lanvin, Loewe, Louis Vuitton, Manolo Blahnik, Marc Jacobs, Marni, Miu Miu, Mulberry, Prada, Salvatore Ferragamo, Thomas Wylde, Tory Burch, Valentino, Versace, Vivienne Westwood, Yves Saint Laurent, 3.1 Phillip Lim, Alexander McQueen, Alexander Wang, Anya Hindmarch, Balenciaga, Bally, Bottega Veneta, Burberry
Post a Comment