perl extracting substrings from string
- From: "archilleswaterland@xxxxxxxxxxx" <archilleswaterland@xxxxxxxxxxx>
- Date: 28 Dec 2006 13:06:24 -0800
$tina = abc_mn123_ln1xy8_dkxhs
I want to get
$mnval = 123;
$lnval = 1;
$xyval = 8;
without using substr thrice.
I tried this .. but this is wrong syntax.
($mnval,$lnval,$xyval) =~ m/^abc_mn(\d\d\d)_ln(\d)xy(\d)_.*$/;
Is there a way I can do this in one go, using a search or match reg
expression ?
thanks.
.
- Follow-Ups:
- Re: perl extracting substrings from string
- From: kens
- Re: perl extracting substrings from string
- From: Dean G.
- Re: perl extracting substrings from string
- Prev by Date: Hashes of Hashes
- Next by Date: Re: perl extracting substrings from string
- Previous by thread: Hashes of Hashes
- Next by thread: Re: perl extracting substrings from string
- Index(es):