reg = /\d+(?=-)/
arry = '-12345-12-123-'.scan(reg)
p arry.min

#puts "-#{arry.min}-"