/^\d{6}-?\d{4}$/
那是
^ Start of string \d{6} a digit, repeated exactly 6 times -? an optional "-" \d{4} a digit, repeated exactly 4 times $ end of string