m/a[ ]b/ # You wish to make it obvious that a space is needed. m/a[ ]{2,5}b/ # You wish to define a quantifier on a whitespace m/a[ ]+b/ # character that would otherwise be difficult to read. m/a[ ]b/x # You're using the /x modifier where whitespace # is ignored by default.