The answer is: it depends.
It depends *greatly* on the specific regex you want to use, and how you want to process the output.
Your examples indicate you want to remove lines from a file that match a particular regex.
If that’s *all* you want to do, and all you will ever want to do, then you should implement your solution using some form of grep (hint: fgrep is super fast, if that’s sufficient for your purposes).
One of the nice thing about Perl is that it allows you to expand your processing later.
Say, in addition to removing lines that match a particular pattern, you also want to count how many lines match some other pattern.
Doing so with grep would be very painful, and you’d probably have to use pipes.
With Perl, adding code to your script to do that is trivial.
More Resources on Is perl faster than egrep:
Read more about Is perl faster than egrep: