Question

I am curious if there is such a regular expression which defines all possible regular expressions. Since there are escape characters that might appear in an RE, it would be tricky to denote such characters in another, say validator, RE since RE's are primarily to describe sequences of alphanumerical characters.

My question can be analogously interpreted as if there is a finite automata which is able to decide a finite-autmata candidate is an FA or not. This is because we know that FA's can be designed in such a way that it rules out a given input string matches the pattern which by the FA is defined or not. So, If we somehow can define everything(FA candidates) as strings, we would be able to define an FA which validates that input is an FA or not. However, I don't know how can I prove this claim, I would be happy if you helped me how I can prove it.

Thanks in advance

Was it helpful?

Solution

To be able to decide if a RE is "legit", you would need to be able to "count parentheses" to check they are balanced, which you can NOT do with a RE (or FA).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top