in reply to Re: Regex for matching dotted numbers
in thread Regex for matching dotted numbers

I have done on similar line as the pattern was not consistent as I was thinking.

  • Comment on Re^2: Regex for matching dotted numbers

Replies are listed 'Best First'.
Re^3: Regex for matching dotted numbers
by jellisii2 (Hermit) on Jul 21, 2014 at 18:31 UTC
    Your supplied test data doesn't suggest this. If it's not 3 or 4 numbers separated by a dot, what is it? If it is separated by a dot, you can check scalar(@ver) to see if it's 3 or 4 numbers, and check $ver[0] to get your major number, and continue from there. You could even use one of the many switch analogs from CPAN to implement switch statements on the version numbers.