Invalid occurrence count encountered.

#4005   Compile-time error or run-time catchable error

Invalid occurrence count encountered.

Additional Information

The minimum occurrence value must be greater than or equal to 0, but is X.
    or
The maximum value must be greater than or equal to 0, but is X.
    or
The first value is X; the second value is Y, but must be at least as large as the first.

Explanation

This error message appears when a negative value is given as the number of times a pattern should be matched. Also, when a range is specified, ( match some pattern { value TO value } ), and one or both of the values is dynamic, this message appears if the second value is less than the first.