Janne is likely right that the difference is negligible and that you should not optimize without benchmarking.
To answer the question anyway, it should depend on what URLs are requested. I would guess that most URLs requested don't have a path that starts with /load_page
. In that case, it's likely that the regexp starting with ^/load_page
will be slightly faster because it can rule out many non-matching strings quickly by comparing the first few characters and not having to backtrack. So if you request /foo
, it will compare the f
to l
, see a mismatch and bail after comparing one or two characters.
With the other regexps, it would see /foo
and think "I'm seeing some fine alphanumerics" and only abort after realizing that the rest of the regexp doesn't match.