On 3/2/06, Jason Vincent <[EMAIL PROTECTED]> wrote:
>
>
>
> If I have a pattern that appears mulitple times (but I don't know how many
> times) in a string, how do I get at the matched text for each of the
> matches?
>
> Made up example…
>
> $string =
> 'ab23cdefgXX(3A5)XXhijkl23mnXX(3)XXopq432rsXX
Title: Regular Expression Question
If I have a pattern that appears mulitple times (but I don't know how many times) in a string, how do I get at the matched text for each of the matches?
Made up example…
$string = 'ab23cdefgXX(3A5)XXhijkl23mnXX(3)XXopq432rsXX(450b)XXtuv';
If ($string =
>
> #!/usr/bin/perl -w
> use strict;
> use warnings;
>
> my %hash = ( "acc12", 1,
> "acc2", 0,
> "acc3", '',
> "una1", 1 );
>
> $hash{acc3} = ();
>
> my $valid="acc1|acc2|acc3";
>
I'd get rid of the pattern matching and put the valid keys in their ow