$imgNumber =~ /^(\d{6})(.*)\.jpg$/
This saves the six digits in $1 and the optional text in $2 (excluding the extension).
In reply to Re: regex help by eieio in thread regex help by calypso