W3C home > Mailing lists > Public > public-qt-comments@w3.org > February 2004

[F&O] CER-10 extract-match

From: Mary Holstege <mary@cerisent.com>
Date: Sun, 15 Feb 2004 11:32:54 -0800
Message-ID: <16431.51558.846000.190166@gargle.gargle.HOWL>
To: public-qt-comments@w3.org


F&O 7.6

Add a function that gives the matches of a regular expression.

    fn:extract-match( $source as xs:string, $regex as xs:string ) as xs:string*

For example:

    extract-match( "some text with 12-11-02 in it", "(\d{2})-(\d{2})-(\d{2})" )
        => ("12", "11", "02" )

This ability is necessary for implementing replace() anyway, but you cannot
do this inside XQuery otherwise, and it is key for performing data
normalization or hit highlighting against regular expression matches.
Received on Tuesday, 17 February 2004 11:10:46 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:13:57 UTC