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 reply to Re: Regex to match 20 chars of some digits followed by some spaces
by Chmrr
in thread Regex to match 20 chars of some digits followed by some spaces
by leriksen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |