>Is this even possible, theoretically speaking?
i wondered that myself.
I think it's correct to say that a regex can't match an unbounded number of
characters unless it contains one of the quantifiers indicated. So the
question is whether these quantifiers can be detected reliably using a regular
expression applied to the regular expression. It's certainly tricky to
distinguish true quantifiers from strings that look like quantifiers but are
escaped with backslashes or square brackets, but I suspect it is possible.
But like others I also wonder whether correctly recognizing such regexes
actually achieves the underlying intended (but unstated) purpose.
Michael Kay
Saxonica
|