Re: subpattern reference using vaiable subpattern index
- From: "Paul Lalli" <mritty@xxxxxxxxx>
- Date: 29 Jan 2007 07:32:04 -0800
On Jan 29, 10:17 am, "Yakov" <iler...@xxxxxxxxx> wrote:
I have submatch index in a variable, $SUB=5. How do I write submatch
reference $5 using $SUB ?
Is ${$SUB} ok ?
What happened when you tried it?
2. Is there array of subpatterns ($1..$<N>) so I can take it's size ?
Just evaluate the pattern match in list context.
my @matches = $x =~ /(foo).*(bar).*(baz)/;
print "Found " . @matches . " matches\n";
If that's not what you meant, please post a short-but-complete program
that demonstrates what you're trying to do and how you're having
difficulty.
Have you read the Posting Guidelines that are posted here twice a
week?
Paul Lalli
.
- References:
- Prev by Date: Re: Downloading lots and lots and lots of files
- Next by Date: Re: Downloading lots and lots and lots of files
- Previous by thread: subpattern reference using vaiable subpattern index
- Next by thread: Re: subpattern reference using vaiable subpattern index
- Index(es):
Relevant Pages
|
|