Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: xsd regular expression query >Thread Next - Re: xsd regular expression query Re: xsd regular expression queryTo: 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
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
