Regular expression in custom registration field

Anyone figured out a way to have a custom field run a regex when data is entered?