SyntaxQ

WMA link


SyntaxQ[“string”]

returns True if “string” corresponds to a syntactically correct input for a Mathics3 expression, or False otherwise.

StringQ