Re: regexp pipe problems..



Christian Winter <thepoet_nospam@xxxxxxxx> wrote:

> So to work around this the easiest solution would be to
> move the hostname pattern outside of the or-clause:
> m{
> ([^/]+)\.(site1|site2|site3)\.org
> /slash/slashey2/
> ( [^/]+ ) / ( \d+ ) / ( \d+ ) / ( [0-9a-zA-Z-]+ )
> }x;
>
> and to change the print statement (or whatever uses the
> captering variables) to ignore $2:


It is probably better to use the non-capturing form of parenthesis,
(?: ... ), for parens # 2:

m{
([^/]+)\. (?: site1|site2|site3 ) \.org


--
Tad McClellan SGML consulting
tadmc@xxxxxxxxxxxxxx Perl programming
Fort Worth, Texas
.