Is there a regular expression that matches valid regular expressions?
(I know there are several flavors of regexps. One would do.)
You probably need a parser, not a regex. Regexes are powerful tools, but are not parsing tools. They are not well suited to nested grammars, for example.