http://www.perlmonks.org?node_id=971612


in reply to Need a regex..

Could you specify whether only one number is entered per line, or if multiple numbers are entered per line, how are they separated?

You can use {n,m} after any matching character/group to specify how often it is allowed to match (minimal n, maximal m). See also QUANTIFIERS.