How do I determine whether a string is a valid handle?

Is there a way to programmatically determine if a string is a valid handle? I’m thinking of a library or API. I’ve checked out the Java client library at ( but didn’t find anything useful. At our organization we filter out handles from many different strings, for example:

We basically want only the values:

Jing, other than checking for the prefix, there isn’t much you can do as basically everything is allowed. DataCite uses this regular expression:


But this excludes characters that allowed in handles, but very hard to work with when used in URLs.