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

Answer Posted / arup

Below Solution is applicable IP only :

(/(\d{1,})\.(\d{1,})\.(\d{1,})\.(\d{1,})/ && $1<256 &&
$2<256 && $3<256 && $4<256)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi, I am a accountant. I am preparing a balance sheet but because of staff shortage and time pressures I cant complete it on time. There is lot of common data with last years which I need not retype and I can manage by editing last year’s balance sheet ? Is their any software on net where I can do this easily??

1754


How do I print the entire contents of an array with Perl?

520


Explain perl. When do you use perl for programming?

443


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

575


How to deleting an existing file in perl programming?

492






What does 'do' statement do in perl?

495


Explain the use of 'my' keyword in perl?

559


What is the difference between single (') and double (") quote in a string in perl?

481


How to disable the mod_perl from apache_server as i have used perlfect search on the site and its pagination is not working and the remedy is to disable the mod_perl.

1788


What is lexical variable in perl?

519


What is grep used for in perl?

527


explain the various functions/directives in perl that allow you to include/import a module. Also, state the differences between them.

460


What is the closure in PERL?

566


How can information be put into hashes?

531


What is it meants by '$_'?

532