if i pass a string (verstring == \"vername.1.19.5\") it will return the version because i am ignoring Currentver[0]. if i want to pass verstring == \"1.19.5\".
I mean i
Here you go:
using System;
using System.Text.RegularExpressions;
namespace RegVer {
class Prog {
static void Main() {
var verstring = "ver:1:9.5";
var dotVerString = verstring.Replace(':','.');
Console.WriteLine(Regex.Match(dotVerString, @"ver\.([\d\.]+)").Groups[1].Value);
}
}
}
Or if you want array with each version digit.
using System;
using System.Text.RegularExpressions;
namespace RegVer {
class Prog {
static void Main() {
var verstring = "ver:1:9.5";
var VerABC = Regex.Matches(verstring, @"\d");
Console.WriteLine("a = " + VerABC[0] + "\n" +
"b = " + VerABC[1] + "\n" +
"c = " + VerABC[2]);
}
}
}