in reply to Re: Nested foreach
in thread Nested foreach

my $ignore = '(?:\b'. join('\b|\b', map quotemeta, @ignore). '\b)';
That's a lot of B's. (I was making a motorboat sound just thinking about that regex. {grin})

Wouldn't this be simpler?

my $ignore = '\b(?:' . join("|", map "\Q$_", @ignore) . ')\b';

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re: •Re: Re: Nested foreach
by broquaint (Abbot) on Apr 25, 2003 at 15:44 UTC
    Wouldn't this be simpler?
    Er, yes, yes it would ;)

    mental note to self - refactor

    _________
    broquaint