in reply to Re^2: regex trouble
in thread regex trouble
You need to capture it (note the parentheses):
#!/usr/bin/perl -l my $para = "xyz-xyz-xyz-xyz-v09.11-e020xyz-xyz-xyz-"; my ($string) = $para =~ m/(v\d{2}\.\d{2}-[a-z]\d{3})/; print $string; # v09.11-e020
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: regex trouble
by blackgoat (Acolyte) on Mar 05, 2010 at 06:50 UTC |