XML Schema Standard 1.0 - W3C - Regular Expressions - Patterns

Dear XML Schema WG members,



I’m currently working on XML schemas to be used for a financial  
application.

There is a specific requirement aiming to provide a data type where:

1)      all strings must be length at least 1 and at most 35;

2)      the sequence “//” is not allowed within the first 16  
characters of each string;

3)      the sequence “//” is allowed within the substring [17..35] of  
each string.

The general idea was to use regular expressions as defined in:

XML Schema Part 2: Datatypes

W3C Recommendation 02 May 2001

F Regular Expressions

and then, to find a suitable “regular expression” to define a proper  
“pattern”, more or less

as in the following:

<xs:simpleType name="First16TextCheck">

<xs:restriction base="xs:string">

<xs:pattern value="????"/>

</xs:restriction>

</xs:simpleType>

However, after several attempts, seems not so simple to define a  
suitable

“regular expression” that matches all the above features (1), (2) and  
(3).

The presence (or absence) of "//" seems to remain a problem when  
using regular

expressions and patterns (mainly because … in my understanding … the  
NOT operator

applies only to single characters and the "-" operator applies to  
group of characters and not

to sets of strings).



Could you kindly provide me any hint about the above issue?



Thank you in advance for your cooperation.



Kind Regards

------------------------------------------------------------------------ 
-

Giovanni Carchesio
Banca d'Italia
Largo Guido Carli 1 - 00044 Frascati (Rome) - Italy
ICT Department
Institutional Applications Development Division
Telephone: +39 06 4792 6689
Fax:          +39 06 4792 6641
E-mail:      giovanni.carchesio@bancaditalia.it
URL:         www.bancaditalia.it




** Le e-mail provenienti dalla Banca d'Italia sono trasmesse in buona  
fede e non
comportano alcun vincolo ne' creano obblighi per la Banca stessa,  
salvo che cio' non
sia espressamente previsto da un accordo scritto.
Questa e-mail e' confidenziale. Qualora l'avesse ricevuta per errore,  
La preghiamo di
comunicarne via e-mail la ricezione al mittente e di distruggerne il  
contenuto. La
informiamo inoltre che l'utilizzo non autorizzato del messaggio o dei  
suoi allegati
potrebbe costituire reato. Grazie per la collaborazione.
-- E-mails from the Bank of Italy are sent in good faith but they are  
neither binding on 
the Bank nor to be understood as creating any obligation on its part  
except where
provided for in a written agreement. This e-mail is confidential. If  
you have received it
by mistake, please inform the sender by reply e-mail and delete it  
from your system.
Please also note that the unauthorized disclosure or use of the  
message or any
attachments could be an offence. Thank you for your cooperation. **

Received on Thursday, 8 February 2007 00:51:21 UTC