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
What is an interpolation in perl?
How can the user execute a long command repeatedly without typing it again and again?
What is perl I used for?
How to create a package?
What is the different between array and hash in perl programming?
How do I sort a hash by the hash key?
How do I debug a perl program?
What does delete function do in perl?
Mention the difference between die and exit in Perl?
Explain the execution of a program in perl.
How to convert strings into an array in perl?
Perl uses single or double quotes to surround a zero or more characters. Are the single(' ') or double quotes (" ") identical?
Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?
What is a chop() function in perl?
How to access parameters passed to a subroutine in perl?