LDAP with numeric id's

We use employee number as the LDAP uid… Has anyone modified this to
handle this condition?
What I need to do is if username is alpha, then use the internal
authentication, if the username is numeric, then use LDAP.

Thanks