Using grepin Ubuntu, I am trying to regex match a pattern that is repeated multiple times in a line.
Example:
0:0, 80:3, 443:0, 8883:0, 9000:0, 9001:0,
The regex I tried is -
([0-9]+:[0-9]+, )+
But it only matches upto -
0:0, 80:3, 443:0, 8883:0, 9000:0,
I would want it to match the complete line. Also, I'd appreciate if the regex will check if there is a presence of 80 and 443 in the matched string.
Expectation -
The following lines should be matched -
0:0, 80:3, 443:0, 8883:0, 9000:0, 9001:0,
0:0, 80:0, 443:1, 8883:0, 9000:0, 9001:0,
0:0, 80:0, 443:0, 8883:0, 9000:0, 9001:0,
0:0, 80:3, 443:1, 8883:0, 9000:0, 9001:0,
and the ones below should not be matched -
0:0, 443:0, 8883:0, 9000:0, 9001:0,
0:0, 80:0, 8883:0, 9000:0, 9001:0,
0:0, 8883:0, 9000:0, 9001:0,