RE: Regular expression functions (Was: Re: [xsl] comments on December F&O draft)

Subject: RE: Regular expression functions (Was: Re: [xsl] comments on December F&O draft)
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Wed, 9 Jan 2002 11:40:08 -0000
> And the XML Schema regexp syntax would need to be
> amended so that it can match the start/end of strings.
>
> Yes. The latter is needed in anycase, fuly anchored regexp's
> make sense
> for schema validating content models of elements but are not
> really what
> you want for a general search/replace system.
>
Just for clarity: although the xf:match() function reuses the syntax and
semantics of regular expressions as defined in schema, the regexp is not
anchored in the case of xf:match(). This is because although schema
specifies that the regexp must match the whole string, xf:match() in effect
tests the regexp against every substring of the supplied string and returns
a list of those substrings that match. I guess this raises the question as
to whether we need an anchored match as well. I think that we've been trying
(perhaps a bit too hard) to avoid making any modification at all to the
regexp syntax and semantics defined in Schema.

I'm interested in your exploration of the use-cases for regexp matching and
possible XSLT constructs to support those use cases, though so far I've had
difficulty following the "make-it-up-as-you-go-along" style of
specification!

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread