WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: Bug: whitespace at beginning of regex fails the regex when in 'x' (ignore whitespace) mode

Bug: whitespace at beginning of regex fails the regex when in 'x' (ignore whitespace) mode

by Abel Braaksma (online) :: Rate this Message:

| View in Thread

Hi all,

Using xsl:analyze-string and applying the flag 'x', whitespace in a
regular expression should be ignored, with the exception of whitespace
in character classes. The following XSLT template prints "NOT FOUND" only.

    <xsl:template match="/">
        <xsl:analyze-string select=" 'abc' " regex=" a" flags="x">
            <xsl:matching-substring>FOUND</xsl:matching-substring>
            <xsl:non-matching-substring>NOT
FOUND</xsl:non-matching-substring>
        </xsl:analyze-string>
    </xsl:template>


I believe this is in error. Whitespace inside the regular expression and
whitespace at the end of the expression is correctly ignored by the parser.

Cheers,
-- Abel Braaksma
   http://www.nuntia.nl

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
saxon-help mailing list
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help

 « Return to Thread: Bug: whitespace at beginning of regex fails the regex when in 'x' (ignore whitespace) mode