"fooXbarYbarQ" =~ /(foo)(.{1,5}?)barQ/ # match entire string