in reply to Re: Why would one want in a regex a class with only a single entry?
in thread Why would one want in a regex a class with only a single entry?

It's not a false economy if, for legibility reasons:

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.

Dave

  • Comment on Re^2: Why would one want in a regex a class with only a single entry?
  • Download Code