I want to extract version number from string.
a string = "Tale: The Secrets 1.6"
b string=" The 34. Mask 1.6.98";
So for a version number is 1.6 and for b is 1.6.98
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
\d+: one or more digits\.: one point(\.\d+)+: one or more occurences of point-digitsWill find
But will not find
If you want to exclude decimal numbers like
2.5and expect a version number to have at least 3 parts, you can use a quantifier like thisAfter the comma, you can specify a maximum number of ocurrences.