Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: xsd regular expression query

From: usenet@--------------.---
To: NULL
Date: 4/3/2007 4:47:00 AM

On 30 Mar, 14:30, ror...@gmail.com wrote:
> On Mar 30, 2:02 pm, Bjoern Hoehrmann <bjo...@hoehrmann.de> wrote:
>
>
>
>
>
> > * ror...@gmail.com wrote in comp.text.xml:
>
> > >I have a regular expression that allows only certain characters to be
> > >valid in an xml doc as follows:
>
> > ><xs:pattern value=3D"^[ dgHhMmstyf,\-\./:;\\]*" />
>
> > >What I want to do is also allow any unicode character that is enclosed
> > >in single quotes to also be valid, no matter where they appear. I
> > >tried the following:
>
> > ><xs:pattern value=3D"^[ dgHhMmstyf,\-\./:;\\]*('*)*" />
>
> > >But this only works if the characters in quotes appear after the other
> > >text.
>
> > You are looking for "(a character from a certain set, or the character '
> > followed by zero or more characters except the character ' followed by
> > the character ') zero or more times", i.e. something like
>
> >   ([a-z]|'[^']*')*
>
> > if the first set of characters was a-z.
> > --
> > Bj=F6rn H=F6hrmann =B7 mailto:bjo...@hoehrmann.de =B7http://bjoern.hoeh=
rmann.de
> > Weinh. Str. 22 =B7 Telefon: +49(0)621/4309674 =B7http://www.bjoernsworl=
d=2Ede
> > 68309 Mannheim =B7 PGP Pub. KeyID: 0xA4357E78 =B7http://www.websitedev.=
de/
>
> Not quite - I want to allow the character(s) in quotes to be able to
> appear with the character(s) from the specified set but not in any
> particular place i.e. not necessarily at the beginning or end. For
> example, I want the following to be valid:
>
> dddd, d. MMMM yyyy
> dddd, d. MMMM MyYear
> MyDay, d. MMMM yyyy
> dddd, d. MyMonth yyyy
>
> so MyDay, MyYear and MyMonth appear in single quotes in the xml file
> and are valid.- Hide quoted text -
>
> - Show quoted text -

It looks to me that Bj=F6rn's pattern achieves this.  (Which filling in
the dots would be:

(^[ dgHhMmstyf,\-\./:;\\]|'[^']*')*

Can you do a test program and show some examples where it does not
work?

Cheers,

Pete.
--
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Pete Cordell
Tech-Know-Ware Ltd
for XML to C++ data binding visit
 http://www.tech-know-ware.com/lmx/
 http://www.codalogic.com/lmx/
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent