Surprisingly I've found this isn't quite true for match vs. search in python. You would think that searching using a regex starting with a ^ anchor might avoid scanning the whole string but it will do so anyway. It makes a huge performance difference if you miss it.