in reply to Should be a simple spaces/digits regex....but I'm turning grey!

From your examples and code fragment as much as from your description, it seems that you are looking for a 7-character string made of spaces followed by digits. Why not simply this:
$num = $1 if length($string) == 7 and $string =~ /^\s*(\d+)$/;
  • Comment on Re: Should be a simple spaces/digits regex....but I'm turning grey!
  • Download Code

Replies are listed 'Best First'.
Re^2: Should be a simple spaces/digits regex....but I'm turning grey!
by viffer (Beadle) on Aug 05, 2014 at 07:30 UTC
    Thanks all

    /^\s*\d+$/

    I'm officially an idiot :)

      I'm officially an idiot :)

      Heavens, no! An idiot is a person who doesn't ask for help. Glad it works for you.

        You're too kind :)
        Once again, thanks to ALL that responded