I have quite a straightforward question. Where I work I see a lot of regular expressions come by. They are used in Perl to get replace and/or get rid of some strings in text
Second method is best in which you put first and second regex together with alternation. Because in that method the perl do traverse once, and check both the expressions.
If you use first method in which perl have to traverse separate for both expressions.
Hence Number of loops decreased in Second method.