in reply to SOLVED Regular Expression help

Thanks that works nicely now.
while ($FileStr !~ m/^([a-zA-Z])\w{0,7}\z/){ }

Replies are listed 'Best First'.
Re^2: Regular Expression help
by Corion (Patriarch) on Jan 07, 2008 at 17:35 UTC

    Try your code with a, ab, abc and abcd. I think your written specification says that of these, only abcd should be accepted, but your regular expression currently accepts all four.

Re^2: Regular Expression help
by suaveant (Parson) on Jan 07, 2008 at 17:35 UTC
    almost works... I'd try a a filename under three characters before turning it in ;)

                    - Ant
                    - Some of my best work - (1 2 3)

Re^2: Regular Expression help
by ikegami (Patriarch) on Jan 07, 2008 at 17:48 UTC
    Furthermore, \w is wrong. It allows characters that shouldn't be allowed. (Specifically, "_")