octetstring – How do I create a regex expression to match 2 to 8 octets, each octet going from 0 to 255?
I’d like a regex expression for 2 to 8 octets, each with values in the range 0-255. Consider the following expressions:
(0-255).(0-255)
(0-255).(0-255).(0-255)
(0-255).(0-255).(0-255).(0-255)
(0-255).(0-255).(0-255).(0-255).(0-255)
(0-255).(0-255).(0-255).(0-255).(0-255).(0-255)
(0-255).(0-255).(0-255).(0-255).(0-255).(0-255).(0-255)
(0-255).(0-255).(0-255).(0-255).(0-255).(0-255).(0-255).(0-255)
I’d like one regex expression that can handle all of the above cases. (0-255) stands for any number in that range.
Read more here: Source link