Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Write a simple regular expression to match an IP address,
e-mail address, city-state-zipcode combination.

Answers were Sorted based on User's Feedback



Write a simple regular expression to match an IP address, e-mail address, city-state-zipcode comb..

Answer / sanjiv

/(\d{3}\.){3}\d+/

Is This Answer Correct ?    3 Yes 6 No

Write a simple regular expression to match an IP address, e-mail address, city-state-zipcode comb..

Answer / anshuman

/^([1-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/



All those above answer are wrong...because all of them take

0.0.0.0 as valid IP address which is not the case...with computer science ...

Developed By Anshuman sengupta

Reviewed by Arnab Bose

Tested by Avishek chatterjee

Is This Answer Correct ?    1 Yes 7 No

Write a simple regular expression to match an IP address, e-mail address, city-state-zipcode comb..

Answer / raghav

For IP Address

/([0-255])(\.)$1\1$1\1$1/;

For other question answer may vary depending on the
requirement.

Is This Answer Correct ?    22 Yes 31 No

Write a simple regular expression to match an IP address, e-mail address, city-state-zipcode comb..

Answer / gopal

I hope this is the right way to match IP address

/((\d{1,3})(\.)){3}\d{1,3}/

Is This Answer Correct ?    12 Yes 24 No

Write a simple regular expression to match an IP address, e-mail address, city-state-zipcode comb..

Answer / leo

/(\d+)(\.\d+){3}/)

Is This Answer Correct ?    4 Yes 16 No

Post New Answer

More CGI Perl Interview Questions

What is stdin in perl?

0 Answers  


How do you you check the return code of a command in perl?

0 Answers   HCL,


How the interpreter is used in Perl?

0 Answers  


Write an expression or perl script to identify the entered ip address is valid or not?

5 Answers   HCL,


Can you add two arrays together?

0 Answers  


How do find the length of an array?

0 Answers  


When would `local $_' in a function ruin your day?

0 Answers  


How do you open a file for writing?

6 Answers  


What does the qq{ } operator do?

0 Answers  


Explain socket programming in perl?

0 Answers  


You want to empty an array. How would you do that?

0 Answers  


How to close a file in perl?

0 Answers  


Categories