Question: UESTION 12 Write a Regular Expression (just the expression) that will match against any valid dotted IP4 address. For simplicity, consider the address as valid
UESTION 12
Write a Regular Expression (just the expression) that will match against any valid "dotted" IP4 address. For simplicity, consider the address as valid if it is in the following form:
A.B.C.D where A, B, C, and D are any numbers between 0 and 255.
Examples of valid addresses (at least valid for our purposes):
0.0.0.0
255.255.255.255
192.168.0.1
(Note that some some of these examples are not actually valid IP addresses due to more complicated numbering rules, but we're just looking at the basic structure here!)
Examples of invalid addresses (these are all truly invalid):
300.0.0.0
27.34
1.2.3.555
Hint: you may want to consider the case of a 3 digit number differently than a 1 or two digit number.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
