Im gonna ask the really dumb question:
What case are we talking about? Cause 001 is ascii for some special character, and 002 is the ascii for bold.
As for case:
$islower(text)
Returns $true if text is all lower case.
$isupper(text)
Returns $true if text is all upper case.
But somehow i think mean the control codes..