in reply to Regex to remove generic accounts

I'm not sure I fully understand what you want, but it may be that
/^(?![XYZ][0-9]{8})/
will do what you want.

Replies are listed 'Best First'.
Re^2: Regex to remove generic accounts
by Lawliet (Curate) on Oct 28, 2008 at 00:36 UTC

    Is there any reason that you used [0-9] rather than \d?

    I'm so adjective, I verb nouns!

    chomp; # nom nom nom

      That did the trick, thanks Monks!
      I will have to look up this ?! code. Is that part of atomic grouping?
      I prefer to use \d instead of [0-9] because it's less typing and special characters :). They are equivalent right?

      Thanks again,
      Ed
        (?!pattern) is a negative look-ahead.

        Take a look at the sub-section Look-Around Assertions in the section on Extended Patterns in perlre.

        They are certainly not equivalent. There are 10 characters that match /[0-9]/. The number of characters that match /\d/ varies from Perl version to Perl version. There are more than 100 characters that match /\d/ in 5.10, and that's only a proper subset of what is being matched in blead.