Strange sunspot activity caused "Mark Frost" <mfrost@ncd.com> to write:
| > /regexp1|regexp2/; # you might want to escape the periods (\.)
|
| Actually, I did try this. I thought I recalled reading somewhere in
| the perl book that putting "|" inside of a regular expression is rather
| inefficient. (Although for the life of me I can't seem to find this
| mentioned in the perl book when I look for it now...)
Page 35 of the Camel book says this:
"(However, we don't recommend that you combine patterns unnecessarily -- it
may be more concise, but it's generally less readable and may run more
slowly.)"
I've never noticed it to be a problem, and definitely think it would be
quicker than creating an array and cycling through the array, which is what
the original suggestion seemed (to me at least) to be proposing.
Steve
|
|