RE: Minutes for XML Query/XSL WG Joint Teleconference #632 2016-02-02

> -----Original Message-----
> From: Michael Kay [mailto:mike@saxonica.com]
> > On 9 Feb 2016, at 17:42, Abel Braaksma <abel.braaksma@xs4all.nl> wrote:
> >
> > I think that [()] is invalid, it should be [\(\)], because capturing inside a class
> is explicitly disallowed, isn't it?
> 
> 
> I checked this in XSD. The only characters that need to be escaped in a
> character class are "[" and "]", or in some situations "-" and "^". It seems that
> parens inside a character class just represent parens to be matched, and
> have no syntactic or semantic significance.
> 
> The existing F+O text didn't explicitly say that opening parens within a
> character class are not counted. I took this as being obviously an oversight,
> and fixed it as part of the tidy-up.
> 

You are right, parens are allowed (I thought I remember tests that actually expected to throw, but I can't find them). I may have been confused with back-references inside classes, which are not allowed.

I.e., [(.)] is allowed (matching dot and parens, no capture)
[(.)\1] is a regex syntax error

> character class are "[" and "]", or in some situations "-" and "^".

Yes, and, obviously, "\" itself.

Thanks,
Abel

Received on Tuesday, 9 February 2016 20:01:26 UTC