in reply to Pattern matching fields with variable or NULL data
while (<DATA>) { print $1."\n" if /^\D*(\d{0,3})\D*$/; } __DATA__ 123 123 123 123 1 2 3 1 12 1 [download]