in reply to regex negative numbers

You didn't watch what you were doing when you copy-and-pasted. Your second regex contains two ^ assertations... in other words, you required the string to begin two sepperate places. (There are circumstances where it is kosher to have two ^s in a regex -- to whit, where there can be nothing between them, or where one is optional. Oh, or if you use the approprate modifer (/m, IIRC, but my memory is bad), ^ will match after a newline as well as at the begnning of the string). Read perlre for more info on regexes.


Confession: It does an Immortal Body good.