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/4/2007 9:41:00 AM On 4 Apr, 17:08, ror...@gmail.com wrote: > On Apr 3, 12:46 pm, use...@tech-know-ware.com wrote: > .=2E. > > 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? > > The pipe(|) in you regular expression means 'or' right? If so then you > can only have the characters dgHhMmstyf,\-\./:;\\ OR characters in > quotes but not both in the same string so you can have: > > dddd, d. MMMM yyyy > OR > 'ab$olutN0n$en$e' > But not > > dddd, d. MMMM yyyy 'ab$olutN0n$en$e' > > Does this make sense? But that's then wrapped in a set of brackets and a *. So you can have any number of occurences of: dddd, d. MMMM yyyy OR 'ab$olutN0n$en$e' which means you can have: dddd, d. MMMM yyyy 'ab$olutN0n$en$e' Note the pattern mentioned earlier is wrong. To match Bjorn's suggestion it should not have had the first ^, so it becomes: ([ dgHhMmstyf,\-\./:;\\]|'[^']*')* I recommend loading the pattern into whatever is the most convenient regular expression parser for you such as Perl, PHP, Java, C#, Javascript, and developing a number of test cases. Then check that each one passes or fails as is appropriate. Then where there's errors, list them here. If you don't have a convenient regular expression engine locally you might be able to download a pure regular expression tester, or do something on the web such as: http://www.nvcc.edu/home/drodgers/ceu/resourc= es/test_regexp.asp BTW - when testing a regular expression destined for a schema on a normal regular expression engine, remember to put ^ and $ anchors around it. HTH, 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 | |||
|
