in reply to Need 2 Regex's

In an attempt to stay on-topic, I offer (untested):

1 . !~/\.(?:jpg|png|gif)$/ 2. perl -e '$f=shift(); -e $f and do{ my ($r,$d)=$f=~/(.+?)(\d*)$/; +$d++; $NEWFILENAME=qq|$r$d\n|}'
More <to-the-point> answers may follow, if asked politely.

     Syntactic sugar causes cancer of the semicolon.        --Alan Perlis