in reply to Regex negative number question

As an additional note:
#find lines that contain the same number twice ... if ($line =~ /(\d+)[^\d]*\1[^\d]/o)
This will not match "1 2 1", but this line contains the number "1" twice.