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
In reply to Re^3: regex trouble
by almut
in thread regex trouble
by blackgoat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |