in reply to Multiple Regex evaluations or one big one?

Have you tried Benchmark to see? You might be surprised.

Even aside from performance issues (which a single regex may or may not resolve), there is the maintenance issue. Is it easier to write, debug, add to, remove from, or generally maintain the code when it's a single regex, or as a series of regexes? Usually, a bunch of small regexes are easier to deal with than a massive one, though if you're dynamically putting the regexes together, that may not be an issue.

  • Comment on Re: Multiple Regex evaluations or one big one?

Replies are listed 'Best First'.
Re^2: Multiple Regex evaluations or one big one?
by flyerhawk (Novice) on Jul 27, 2011 at 22:19 UTC
    Thanks for the info. So I guess it really isn't a big deal either way. I will probably just iterate out each expression then using. I think the code will look a little better that way.