I'm running this regular expression to separate the digits of a version:
([\d]+)+
As you can see in this example , it works well enough to cover my needs.
However, I have to add this to a Perl script, which is not my specialty. I run my regex and then try to retrieve the values from the group.
$version="2.2.1-ALPHA30";
$version=~/([\d]+)+/g;
print "major:$1 minor:$2 revision:$3 build:$4\n"
First that I only have $1
that is shown, the others are empty.
And finally, I see no way of knowing how many values were found by regex.