Given a strings like:
S5.4.2
3.2
SD45.G.94L5456.294.1004.8888.0.23QWZZZZ
5.44444444444444444444444444444.5GXV
You would need to return:
5.4.2
3.2
5456.294.1004.8888.0.23
5.44444444444444444444444444444.5
Is there a smart way to write a method to extract only the IP address-like number from it? (I say IP Address-like because I'm not sure if IP addresses are usually a set amount of numbers or not). One of my friends suggested that there might be a regex for what I'm looking for and so I found this. The problem with that solution is I think it is limited to only 4 integers total, and also won't expect ints like with 4+ digits in between dots.
I would need it to recognize the pattern:
NUMS DOT (only one) NUMS DOT (only one) NUMS
Meaning:
234..54.89 FAIL
.54.6.10 FAIL
256 FAIL
234.7885.924.120.2.0.4 PASS
Any ideas? Thanks everyone. I've been at this for a few hours and can't figure this out.