in reply to regex behaves differently in split vs substitute?
You can use this below code for extracting the version
use strict; use warnings; while (my $line = <DATA>) { chomp $line; if ($line =~ /^[a-z-]+(\d.*)$/) { print ">>$1<<\n"; } } __DATA__ mono-basic-2.10 mono-2.10.2-r1 mono-2.10.5
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex behaves differently in split vs substitute?
by Marshall (Canon) on Oct 08, 2011 at 12:58 UTC | |
by Anonymous Monk on Oct 08, 2011 at 13:36 UTC | |
by Anonymous Monk on Oct 08, 2011 at 13:19 UTC | |
by Marshall (Canon) on Oct 08, 2011 at 13:54 UTC | |
by Anonymous Monk on Oct 08, 2011 at 13:58 UTC | |
by AnomalousMonk (Archbishop) on Oct 08, 2011 at 18:43 UTC |