in reply to Moose Attribute constraint: Regex OR undef

Can you show us a short program that shows the intended usage of your class? Also, what errors do you currently get (or not)?

I assume that where takes a subroutine reference which gets the thing to test in $_, so maybe the following already is enough?

... where { not defined $_ or $_ =~ /$regEx/ }

Update: Negated the expression, thanks to 1nickt