[F&O] CER-10 extract-match

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