You could include a configuration attribute in your doc:
//! A regular expression can be defined right in place:
//!
//! ```
//! # #[cfg(feature="regex")]
//! # mod wrapper_module {
//!
//! use nutype::nutype;
//!
//! #[nutype(validate(regex = "^[0-9]{3}-[0-9]{3}$"))]
//! pub struct PhoneNumber(String);
//!
//! # }
//! ```
The code will still show in the documentation, but from what I understand, it's not what you're trying to avoid.