Re: [xsl] Need an XPath expression which returns all xs:pattern elements containing a regex that permits an unbounded number of characters

Subject: Re: [xsl] Need an XPath expression which returns all xs:pattern elements containing a regex that permits an unbounded number of characters
From: "Michael Kay michaelkay90@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 4 Apr 2024 15:39:59 -0000
>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

Current Thread