RE: RegEx [+\-] or [+-]?

The Microsoft schema processor (from my observations) allows very many
regular expressions that are not permitted by the XML schema specification.
In fact, I believe it just uses the .NET regex parser unchanged.
 
There's a long and tortuous history of errors, errata, corrections to
errata, and withdrawn errata in the area of hyphens within square brackets.
It's my belief that the current intent of the spec is to permit [+-], though
there's still a contradiction between the grammar and the text; given the
history, it's not at all surprising if you find products that don't permit
it.
 
So:
 
 (a) the fact that Microsoft accept it proves nothing, 
 
 (b) [+-] should be OK, 
 
 (c) it's not surprising if some (especially older) products reject it 
 
 (d) [+\-] should be safe.
 
Michael Kay
http://www.saxonica.com/


  _____  

From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On
Behalf Of Rao,Dr.,R.,SNL IT Filialen,4110,DA
Sent: 05 June 2007 11:50
To: xmlschema-dev@w3.org
Subject: RegEx [+\-] or [+-]?



The regEx below make restrictions on the UTC-Offset in the datetime data
type.

We found out that the expression 1 makes no problem with the Microsoft
parser (.net 2.0).

A third party which receives data from us, uses Java and have problems with
1. They would like the expression 2.

 

1: <xs:pattern
value="\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d([+-](0[0-9]|1[0-2]):00|[+-](03|09):30|
[+](13|14):00|[+](04|05|06|10|11):30|[-]08:30)"/>

2: <xs:pattern
value="\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d([+\-](0[0-9]|1[0-2]):00|[+\-](03|09):3
0|[+](13|14):00|[+](04|05|06|10|11):30|[\-]08:30)"/>

 

 

Which is the recommended expression?

 

Thanks,  Roberto

 

Dr. Roberto Rao 
Deutsche Post AG 

SNL IT FILIALEN
4110-5 / Architektur 
Poststraße 4-6, Raum B 03a
64293 Darmstadt 

 

Tel: (0 61 51) 9 07 31 18 

Fax: (0 61 51) 3 90 94 10 01 
Mobil: (0170) 9 27 06 87 
E-Mail:  <mailto:R.Rao@DeutschePost.de> mailto:R.Rao@DeutschePost.de

 

________________________________

Dies ist eine Nachricht der Deutsche Post AG und kann vertrauliche,
firmeninterne Informationen enthalten. Sie ist ausschließlich für die oben
adressierten Empfänger bestimmt. Sind Sie nicht der beabsichtigte Empfänger,
bitten wir Sie, den Sender zu informieren und die Nachricht sowie deren
Anhänge zu löschen. Unzulässige Veröffentlichungen, Verwendungen,
Verbreitung, Weiterleitung sowie das Drucken oder Kopieren dieser Mail und
ihrer verknüpften Anhänge sind strikt untersagt. 

 

Bitte denken Sie über Ihre Verantwortung gegenüber der Umwelt nach, bevor
Sie diese Email ausdrucken!

 

Deutsche Post AG

Aktiengesellschaft

Vorstand: Dr. Klaus Zumwinkel (Vorstandsvorsitzender), John M. Allan, Dr.
Frank Appel, Prof. Dr. Edgar Ernst, John P. Mullen, Dr. Hans-Dieter Petram,
Walter Scheurle, Prof. Dr. Wulf von Schimmelmann

Vorsitzender des Aufsichtsrates: Dr. Jürgen Weber

Sitz Bonn

Handelsregister-Nummer: Registergericht Bonn HRB 6792   

USt-IdNr: DE 169838187

Received on Tuesday, 5 June 2007 16:26:03 UTC