m/ ^ # start of line 1? # the number 1, zero or one time $ # end of line | # alternation ^ # start of line ( # remember the match in \1 11+? # the number 1, then the number 1 once or more times, but the less time possible ) # \1+ # the matched sequence, once or more. $ /x ;