in reply to efficient method of matching a string against a list of substrings?

my $re = join '|', @sub; $re = qr/($re)/; $str =~ $re;

Dave.

  • Comment on Re: efficient method of matching a string against a list of substrings?
  • Download Code

Replies are listed 'Best First'.
Re^2: efficient method of matching a string against a list of substrings?
by diggler (Initiate) on May 05, 2005 at 00:53 UTC
    very large regexes can be even more inefficient. when i say large list, think hundreds or thousands of strings.