On Fri, 21 Feb 2014 16:21:57 +0200
Wernher Eksteen <[email protected]> wrote:
> Hi all,
>
> From the below file names I only need the version number 1.2.4 without
> explicitly specifying it.
>
> check_mk-1.2.4.tar.gz
> check_mk-agent-1.2.4-1.noarch.rpm
> check_mk-agent-logwatch-1.2.4-1.noarch.rpm
> check_mk-agent-oracle-1.2.4-1.noarch.rpm
> mk-livestatus-1.2.4.tar.gz
> mkeventd-1.2.4.tar.gz
>
> What regex can I use to obtain only the string value 1.2.4 from the
> file names (or whatever future versions based on the 3 numbers
> separated by 3 dots, [0-9].[0-9].[0-9]?
>
> Thanks!
> Wernher
/\b(\d+\.\d+\.\d+)\b/
--
Don't stop where the ink does.
Shawn
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/