RegEx III (WAS: an effective script for grabbing and putting images from or to a website)



Cal Dershowitz <cal@xxxxxxxxxxxxxxx> wrote:
One thing I didn't appreciate in such character
classes was that the order was being preserved, so you rely on it not
coming back "gpj."

You are thinking about REs the wrong way. It is not the class or the RE
that is "coming back". REs match (part of) a string. And the capture
always contains that part of the original string that was matched, no
matter how or which RE matched it.
Therefore your mental model of "the character class is returning
something" is very misleading and you should dump it asap.

jue
.