in reply to regex that simulates boolean logic

If it is ugly code then generally it is is not good code, and something like a regex can easily fool you into thinking it is working right up until it breaks.

If these values are going into a config file why not list them like:

7000,7777,7778,3886200, ...

and then place them in a hash, say %not_allowed. You could then check your input using:

unless ( exists $not_allowed{ $input } ) { # do your stuff }

This may require more lines of code but would be much easier to check and understand, and also easier to edit by hand - working with a list not a regex.