This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I need some support with a challenge - I have a string and I would like to output the part where numbers are present:
e.g. (string example | desired output):
C1.6.2-texttext | 1.6.2
2.3-blabla | 2.3
1-blablabla | 1
18.104.22.168-texttexttext | 22.214.171.124
There is always a "-" before the text starts, but the numbers can go several levels deep (1; 1.2; 1.2.3; 126.96.36.199, etc.) and there could be a "prefix", but not necessary. I think the examples above cover all my potential scenarios. I assume a clever RegEx can solve the issue, but I failed to produce something that would work.