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 a chop() function in perl?
Who created perl?
what are prefix dereferencer and list them out?
Where the command line arguments are stored and if you want to read command-line arguments with Perl, how would you do that?
How to print escaping characters inside a string in perl?
Explain splicing of arrays?
What is the function of cgiwrap in cgi programming?
Why do we use "use strict" in perl?
In Perl, what is grep function used for?
What is perl unshift array function?
What does cgi program store?
what are the strategies followed for multiple form interaction in cgi programs?
Differentiate between arrays and list in perl.
What are perl strings?
How will you get the count of parameters passed to a perl subroutine?