Originally Posted by
Cat
I wouldn't say "significantly" slower, since either of them is fast enough to be effectively instantaneous to human perception.
Personally, as long as I'm not using a wildly inappropriate algorithm (like an O(N^3) linked list removal or something) my focus is always on readable, maintainable code. If there are actually performance concerns, then I'll rewrite if necessary, but in a lot of cases, the actual processing takes tiny fractions of a second and then idles waiting for user input. Whether it takes 100 nanoseconds or 10,000 nanoseconds, it's still effectively instantaneous to human perception, which finds anything less than about 100 microseconds to be "immediate".
The printing to the console is going to take orders of magnitude longer than either the regular expression or the character-based pattern matching.