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



Cal Dershowitz <cal@xxxxxxxxxxxxxxx> wrote:

... but I still don't understand why deleted material is not also
returned in this idiom:

my ($ext) = $name =~ /([^.]*)$/;

But there is no "deleted material" to begin with.

A regular expression matches text. What text does this one match? From
the end of the string forward anything that is not a dot. And that match
is captured by the paranthesis and thus copied to $ext.

There is nothing deleted at all. Just print $name and you will notice
that it didn't change one bit.

jue
.