$in =~ /^ (?=.{23}(.{15})) # field one (?=.{28}(.{10})) # field two /xs or warn "bad input: $in ";