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

How to renaming a file in perl programming?

0 Answers  


How to sort arrays in perl?

0 Answers  


How can the user execute a long command repeatedly without typing it again and again?

0 Answers  


Explain the internal working of cgi

0 Answers  


Is perl a case sensitive language?

0 Answers  


Explain a tell function in perl?

0 Answers  


Is perl compiler or interpreter?

0 Answers  


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

0 Answers   HCL,


What is the tk module?

0 Answers  


How to make the following assignment, as arrayreference assignment ? my $arr_ref='[1,2,3,4,4,'elem']';

2 Answers  


my @array=('data1','data2'); my @array1=('data1','data2'); my ($i,$k); $i=7; $k=7; while($i){ $array [++$#array] = 'ree'; $i--; print "@array"; } while($k){ push(@array1,'ree'); $k--; print "@array1"; } Are these two while loop are doing the same functionality ? What may be the difference?

1 Answers   A1 Technology,


How will you open a file in read-only mode in perl?

0 Answers  


Categories