Coupon Code - Any String of X Characters

We’d like to implement a discount for members of a certain group. We want to tell them to input their membership number as the coupon code to receive the discount. We don’t want to actually verify the number, just to make sure it has the right number of characters. Is there a simple/graceful way to do this?

Example: Set up a coupon code for Club A. Any member of Club A inputs a 5 digit membership number like 54321 and the code is applied.

Thanks for any thoughts.