in reply to Regex to match 20 chars of some digits followed by some spaces
Yet another way to do it: /^\d+ *(?<=^.{20})$/ That is, one or more digits, followed by zero or more spaces -- and only thereafter do we check that it summed to 20 characters total. Probably not as efficient (involves more backtracking) but easier for my eyes to understand.
|
---|
In Section
Seekers of Perl Wisdom