I'm using an escaped caret and dollar sign to indicate the start and end of each line together with a non-greedy regular expression for matching any leading & trailing whitespaces as this requires matching the pattern at the beginning and end of a whole line. The regex checks for consecutive groups of five numbers possibly with a single 	 or - as a separator