in reply to Detecting if a string is a regular expression

Wouldn't $b also be a regular expression, and $a also be a valid string? In other words, what are your criteria?

--MidLifeXis