Write a simple regular expression to match an IP address,
e-mail address, city-state-zipcode combination.
Answer Posted / treddy
Hi all,
Here is the regular expression for matching the valid ip
address.
^(25[0-5]|2[0-4]{0,1}[0-9]{0,1}|1[0-9]{1,2}|[0-9]{1,2})[.](25[0-5]|2[0-4]{0,1}[0-9]{0,1}|1[0-9]{1,2}|[0-9]{1,2})[.](25[0-5]|2[0-4]{0,1}[0-9]{0,1}|1[0-9]{1,2}|[0-9]{1,2})[.](25[0-5]|2[0-4]{0,1}[0-9]{0,1}|1[0-9]{1,2}|[0-9]{1,2})$
Let me know your comments.
Thanks,
TReddy
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to create a directory in perl?
What are the various flags/arguments that can be used while executing a perl program?
Write a program to download the contents from www.perlinterview.com/answers.php website in Perl.
What is the main function of cookie server?
What is perl scripting?
how to extract pin_code,phone_number,year from text file using regular expressions in perl
How and what are closures implemented in perl?
What is the peculiarity of returning values by subroutines in perl?
How many data types are there in perl?
What are the advantages of c over Perl?
What are the various perl data types based on the context?
Explain arrays in perl.
What is boolean context?
What does length(%HASH) produce if you have thirty-seven random keys in a newly created hash?
Which functions in Perl allows you to include a module file or a module and what is the difference between them?