check if a string is a salesforce id

Are you checking just a string itself, or is there metadata available that you could also check (checking for field type, for example)?