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

Answer Posted / vyvyan

ip_pattern = r'\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b'

Is This Answer Correct ?    26 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does the q{ } operator do?

517


Why to use perl?

543


How does a “grep” function perform?

599


What is warn function in perl?

533


How many data types are there in perl?

535






Can you add two arrays together?

528


What is the usage of -i and 0s options?

548


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

513


Explain what is the scalar data and scalar variables in Perl?

568


There are two types of eval statements i.e. Eval expr and eval block. Explain them.

483


What is the importance of perl warnings?

541


Explain the arguments for perl interpreter.

529


What is the difference between perl array and perl hash?

523


What does 'do' statement do in perl?

502


How are parameters passed to subroutines in perl?

507