I hope your employer is encouraging the
XQuery WG to get better regular expression support into XQuery 1.0. The WG
seem to be rowing back a bit from the Use Case that still (for the moment)
says "Full-text Search". I am concerned that the reg exp support may, in the
end, be fairly feeble. I hope I am wrong.
XSLT 2.0 is better off since
it is expected to have the xsl:analyze-string element to do a reasonable
amount of reg exp stuff.
I think the main difference between the XSLT 2.0
capability for regular expressions and the XQuery 1.0 capability (matches(),
replace(), and tokenize()) is that the xsl:analyze-string construct gives the
ability to find non-XML structure in the text and turn it into markup. I think
this is definitely a transformation task rather than a query task. For query,
people will normally create as much marked-up structure as they can
before loading documents into a database.
Certainly, the three functions above met all the
XQuery use cases that we identified.