On Thu, Sep 18, 2003 at 11:30:43AM +0100, Gareth Reakes wrote:
> > So the first question is: does that class do what I need? Is that class
> > implementing the Schema regular expressions?
> Almost definitely.

Uhm, maybe there's some preprocessing of expressions then?
Otherwise I can't explain why matching "123" against regexp "\d{3}"
fails.

The following simple program:

  int main(int argc, char **argv) {
          XMLPlatformUtils::Initialize();
          {
                  RegularExpression *rex;
                  rex = new RegularExpression("\\d{3}");
                  if (rex->matches("123"))
                          std::cout << "Eureka!" << std::endl;
                  else
                          std::cout << "Sob :-(" << std::endl;
          }
          XMLPlatformUtils::Terminate();
  }
  
indeed returns "Sob".

Moreover I've seen also that matching "foo" against regexp "f" succeed,
but it should fail.

OTOH if I try to write a schema document with the pattern "\d{3}" it
correctly recognize "123" ...

> > What am I doing wrong? Any hints?
> Are you initialising xerces? If you want to see some examples of how to 

No, I wasn't, because I was misleaded by the name of the initialization
function and I wrongly guessed that I was needed only if using some XML
stuff like parser and similar. Sorry, my fault.

Thanks for your answer,
Cheers.

-- 
Stefano Zacchiroli  --  Master in Computer Science @ Uni. Bologna, Italy
[EMAIL PROTECTED],debian.org,bononia.it}  -  http://www.bononia.it/zack/
"  I know you believe you understood what you think I said, but I am not
sure you realize that what you heard is not what I meant!  " -- G.Romney

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to