[Israel.pm] Regex question

Avishalom Shalit avishalom at gmail.com
Sat Jan 24 17:14:59 PST 2009


no answer, but i did spend two minutes manually diffing it so ,
here's my contribution
added line numbers .

the only difference i found was lines 5 and 8 (with the * taking its
proper place. )

so i take the question to mean is there an effect to the non capturing
parens with the * at the end. ?

i don't know , i have a guess (no effect)


2009/1/25 Shmuel Fomberg <semuelf at 012.net.il>:
> Hi All.
>
> Is it correct that this regex:
>
1> $content =~ /^(
2>        [\$@%&*]
3>        (?: : (?!:) | # Allow single-colon non-magic vars
4>                (?: \w+ | \' (?!\d) \w+ | \:: \w+ )
5>                (?:
6>                        # Allow both :: and ' in namespace separators
7>                        (?: \' (?!\d) \w+ | \:: \w+ )
8>                )*
9>                (?: :: )? # Technically a compiler-magic hash, but
keep                                   #it here
>        )
> )/x;
>
> is the same is this?
>
> $content =~ /^(
>        [\$@%&*]
>        (?: : (?!:) | # Allow single-colon non-magic vars
>                (?: \w+ | \' (?!\d) \w+ | \:: \w+ )
>        )
>        # Allow both :: and ' in namespace separators
>        (?: \' (?!\d) \w+ | \:: \w+ )*
>        (?: :: )? # Technically a compiler-magic hash, but keep it here
> )/x;
>
> Thanks,
> Shmuel.
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
>



-- 
-- vish



More information about the Perl mailing list